Power_Ip_SCG.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral :
  5. * Dependencies : none
  6. *
  7. * Autosar Version : 4.4.0
  8. * Autosar Revision : ASR_REL_4_4_REV_0000
  9. * Autosar Conf.Variant :
  10. * SW Version : 1.0.0
  11. * Build Version : S32K1_RTD_1_0_0_HF01_D2109_ASR_REL_4_4_REV_0000_20210907
  12. *
  13. * (c) Copyright 2020-2021 NXP Semiconductors
  14. * All Rights Reserved.
  15. *
  16. * NXP Confidential. This software is owned or controlled by NXP and may only be
  17. * used strictly in accordance with the applicable license terms. By expressly
  18. * accepting such terms or by downloading, installing, activating and/or otherwise
  19. * using the software, you are agreeing that you have read, and that you agree to
  20. * comply with and are bound by, such license terms. If you do not agree to be
  21. * bound by the applicable license terms, then you may not retain, install,
  22. * activate or otherwise use the software.
  23. ==================================================================================================*/
  24. /**
  25. * @file Power_Ip_SCG.h
  26. * @version 1.0.0
  27. *
  28. * @brief POWER IP driver header file.
  29. * @details POWER IP driver header file.
  30. *
  31. * @addtogroup POWER_DRIVER Power Ip Driver
  32. * @{
  33. */
  34. #ifndef POWER_IP_SCG_H
  35. #define POWER_IP_SCG_H
  36. #ifdef __cplusplus
  37. extern "C"{
  38. #endif
  39. /*==================================================================================================
  40. INCLUDE FILES
  41. 1) system and project includes
  42. 2) needed interfaces from external units
  43. 3) internal and external interfaces from this unit
  44. ==================================================================================================*/
  45. #include "Power_Ip_Cfg_Defines.h"
  46. #if defined(POWER_IP_S32K116)
  47. #include "S32K116_SCG.h"
  48. #elif defined(POWER_IP_S32K118)
  49. #include "S32K118_SCG.h"
  50. #elif defined(POWER_IP_S32K142)
  51. #include "S32K142_SCG.h"
  52. #elif defined(POWER_IP_S32K142W)
  53. #include "S32K142W_SCG.h"
  54. #elif defined(POWER_IP_S32K144)
  55. #include "S32K144_SCG.h"
  56. #elif defined(POWER_IP_S32K144W)
  57. #include "S32K144W_SCG.h"
  58. #elif defined(POWER_IP_S32K146)
  59. #include "S32K146_SCG.h"
  60. #elif defined(POWER_IP_S32K148)
  61. #include "S32K148_SCG.h"
  62. #else
  63. #error "Derivative not found"
  64. #endif
  65. #include "StandardTypes.h"
  66. #include "OsIf.h"
  67. #include "Mcal.h"
  68. /*==================================================================================================
  69. SOURCE FILE VERSION INFORMATION
  70. ==================================================================================================*/
  71. #define POWER_IP_SCG_VENDOR_ID 43
  72. #define POWER_IP_SCG_AR_RELEASE_MAJOR_VERSION 4
  73. #define POWER_IP_SCG_AR_RELEASE_MINOR_VERSION 4
  74. #define POWER_IP_SCG_AR_RELEASE_REVISION_VERSION 0
  75. #define POWER_IP_SCG_SW_MAJOR_VERSION 1
  76. #define POWER_IP_SCG_SW_MINOR_VERSION 0
  77. #define POWER_IP_SCG_SW_PATCH_VERSION 0
  78. /*==================================================================================================
  79. FILE VERSION CHECKS
  80. ==================================================================================================*/
  81. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  82. /* Check if Power_Ip_SCG.h file and StandardTypes.h file are of the same Autosar version */
  83. #if ((POWER_IP_SCG_AR_RELEASE_MAJOR_VERSION != STD_AR_RELEASE_MAJOR_VERSION) || \
  84. (POWER_IP_SCG_AR_RELEASE_MINOR_VERSION != STD_AR_RELEASE_MINOR_VERSION))
  85. #error "AutoSar Version Numbers of Power_Ip_SCG.h and StandardTypes.h are different"
  86. #endif
  87. /* Check if Power_Ip_SCG.h file and Mcal.h file are of the same Autosar version */
  88. #if ((POWER_IP_SCG_AR_RELEASE_MAJOR_VERSION != MCAL_AR_RELEASE_MAJOR_VERSION) || \
  89. (POWER_IP_SCG_AR_RELEASE_MINOR_VERSION != MCAL_AR_RELEASE_MINOR_VERSION))
  90. #error "AutoSar Version Numbers of Power_Ip_SCG.h and Mcal.h are different"
  91. #endif
  92. /* Check if Power_Ip_SCG.h file and OsIf.h file are of the same Autosar version */
  93. #if ((POWER_IP_SCG_AR_RELEASE_MAJOR_VERSION != OSIF_AR_RELEASE_MAJOR_VERSION) || \
  94. (POWER_IP_SCG_AR_RELEASE_MINOR_VERSION != OSIF_AR_RELEASE_MINOR_VERSION))
  95. #error "AutoSar Version Numbers of Power_Ip_SCG.h and OsIf.h are different"
  96. #endif
  97. #endif
  98. /* Check if Power_Ip_SCG.h file and Power_Ip_Cfg_Defines.h file have same versions */
  99. #if (POWER_IP_SCG_VENDOR_ID != POWER_IP_CFG_DEFINES_VENDOR_ID)
  100. #error "Power_Ip_SCG.h and Power_Ip_Cfg_Defines.h have different vendor IDs"
  101. #endif
  102. /* Check if Power_Ip_SCG.h file and Power_Ip_Cfg_Defines.h file are of the same Autosar version */
  103. #if ((POWER_IP_SCG_AR_RELEASE_MAJOR_VERSION != POWER_IP_CFG_DEFINES_AR_RELEASE_MAJOR_VERSION) || \
  104. (POWER_IP_SCG_AR_RELEASE_MINOR_VERSION != POWER_IP_CFG_DEFINES_AR_RELEASE_MINOR_VERSION) || \
  105. (POWER_IP_SCG_AR_RELEASE_REVISION_VERSION != POWER_IP_CFG_DEFINES_AR_RELEASE_REVISION_VERSION))
  106. #error "AutoSar Version Numbers of Power_Ip_SCG.h and Power_Ip_Cfg_Defines.h are different"
  107. #endif
  108. /* Check if Power_Ip_SCG.h file and Power_Ip_Cfg_Defines.h file are of the same Software version */
  109. #if ((POWER_IP_SCG_SW_MAJOR_VERSION != POWER_IP_CFG_DEFINES_SW_MAJOR_VERSION) || \
  110. (POWER_IP_SCG_SW_MINOR_VERSION != POWER_IP_CFG_DEFINES_SW_MINOR_VERSION) || \
  111. (POWER_IP_SCG_SW_PATCH_VERSION != POWER_IP_CFG_DEFINES_SW_PATCH_VERSION))
  112. #error "Software Version Numbers of Power_Ip_SCG.h and Power_Ip_Cfg_Defines.h are different"
  113. #endif
  114. /*==================================================================================================
  115. * CONSTANTS
  116. ==================================================================================================*/
  117. /*==================================================================================================
  118. DEFINES AND MACROS
  119. ==================================================================================================*/
  120. #define SCG_SCS_SIRC_U32 (2U)
  121. /*==================================================================================================
  122. * ENUMS
  123. ==================================================================================================*/
  124. /*==================================================================================================
  125. * STRUCTURES AND OTHER TYPEDEFS
  126. ==================================================================================================*/
  127. /*==================================================================================================
  128. * GLOBAL VARIABLE DECLARATIONS
  129. ==================================================================================================*/
  130. /*==================================================================================================
  131. * FUNCTION PROTOTYPES
  132. ==================================================================================================*/
  133. #define MCU_START_SEC_CODE
  134. #include "Mcu_MemMap.h"
  135. #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
  136. #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
  137. #define Call_Power_Ip_SCG_DisableClockMonitors() \
  138. do\
  139. { \
  140. OsIf_Trusted_Call(Power_Ip_SCG_DisableClockMonitors); \
  141. }\
  142. while(0)
  143. #else
  144. #define Call_Power_Ip_SCG_DisableClockMonitors() \
  145. do\
  146. { \
  147. Power_Ip_SCG_DisableClockMonitors(); \
  148. }\
  149. while(0)
  150. #endif
  151. #endif
  152. #if (POWER_IP_NO_PLL == STD_OFF)
  153. #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
  154. #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
  155. #define Call_Power_Ip_SCG_DisableSpllClock() \
  156. do\
  157. { \
  158. OsIf_Trusted_Call(Power_Ip_SCG_DisableSpllClock); \
  159. }\
  160. while(0)
  161. #else
  162. #define Call_Power_Ip_SCG_DisableSpllClock() \
  163. do\
  164. { \
  165. Power_Ip_SCG_DisableSpllClock(); \
  166. }\
  167. while(0)
  168. #endif /* POWER_IP_NO_PLL */
  169. #endif
  170. #endif
  171. #if (MCU_ENTER_LOW_POWER_MODE == STD_ON)
  172. #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
  173. #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
  174. #define Call_Power_Ip_SCG_DropSysClkToSircInRunMode() \
  175. do\
  176. { \
  177. OsIf_Trusted_Call(Power_Ip_SCG_DropSysClkToSircInRunMode); \
  178. }\
  179. while(0)
  180. #else
  181. #define Call_Power_Ip_SCG_DropSysClkToSircInRunMode() \
  182. do\
  183. { \
  184. Power_Ip_SCG_DropSysClkToSircInRunMode(); \
  185. }\
  186. while(0)
  187. #endif
  188. #endif
  189. #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
  190. #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
  191. #define Call_Power_Ip_SCG_DisableFircClock() \
  192. do\
  193. { \
  194. OsIf_Trusted_Call(Power_Ip_SCG_DisableFircClock); \
  195. }\
  196. while(0)
  197. #else
  198. #define Call_Power_Ip_SCG_DisableFircClock() \
  199. do\
  200. { \
  201. Power_Ip_SCG_DisableFircClock(); \
  202. }\
  203. while(0)
  204. #endif
  205. #endif
  206. #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
  207. #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
  208. #define Call_Power_Ip_SCG_DisableSoscClock() \
  209. do\
  210. { \
  211. OsIf_Trusted_Call(Power_Ip_SCG_DisableSoscClock); \
  212. }\
  213. while(0)
  214. #else
  215. #define Call_Power_Ip_SCG_DisableSoscClock() \
  216. do\
  217. { \
  218. Power_Ip_SCG_DisableSoscClock(); \
  219. }\
  220. while(0)
  221. #endif
  222. #endif
  223. #endif /* (MCU_ENTER_LOW_POWER_MODE == STD_ON) */
  224. void Power_Ip_SCG_DisableClockMonitors(void);
  225. #if (POWER_IP_NO_PLL == STD_OFF)
  226. void Power_Ip_SCG_DisableSpllClock(void);
  227. #endif /* POWER_IP_NO_PLL */
  228. #if (MCU_ENTER_LOW_POWER_MODE == STD_ON)
  229. void Power_Ip_SCG_DropSysClkToSircInRunMode(void);
  230. void Power_Ip_SCG_DisableFircClock(void);
  231. void Power_Ip_SCG_DisableSoscClock(void);
  232. #endif
  233. #define MCU_STOP_SEC_CODE
  234. #include "Mcu_MemMap.h"
  235. #ifdef __cplusplus
  236. }
  237. #endif
  238. #endif /* POWER_IP_SCG_H */
  239. /** @} */