Power_Ip_RCM.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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_RCM.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_RCM_H
  35. #define POWER_IP_RCM_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_RCM_Types.h"
  46. #include "Power_Ip_Cfg.h"
  47. #include "StandardTypes.h"
  48. #include "Mcal.h"
  49. /*==================================================================================================
  50. SOURCE FILE VERSION INFORMATION
  51. ==================================================================================================*/
  52. #define POWER_IP_RCM_VENDOR_ID 43
  53. #define POWER_IP_RCM_AR_RELEASE_MAJOR_VERSION 4
  54. #define POWER_IP_RCM_AR_RELEASE_MINOR_VERSION 4
  55. #define POWER_IP_RCM_AR_RELEASE_REVISION_VERSION 0
  56. #define POWER_IP_RCM_SW_MAJOR_VERSION 1
  57. #define POWER_IP_RCM_SW_MINOR_VERSION 0
  58. #define POWER_IP_RCM_SW_PATCH_VERSION 0
  59. /*==================================================================================================
  60. FILE VERSION CHECKS
  61. ==================================================================================================*/
  62. /* Check if Power_Ip_RCM.h file and Power_Ip_RCM_Types.h file are of the same vendor */
  63. #if (POWER_IP_RCM_VENDOR_ID != POWER_IP_RCM_TYPES_VENDOR_ID)
  64. #error "Power_Ip_RCM.h and Power_Ip_RCM_Types.h have different vendor ids"
  65. #endif
  66. /* Check if Power_Ip_RCM.h file and Power_Ip_RCM_Types.h file are of the same Autosar version */
  67. #if ((POWER_IP_RCM_AR_RELEASE_MAJOR_VERSION != POWER_IP_RCM_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  68. (POWER_IP_RCM_AR_RELEASE_MINOR_VERSION != POWER_IP_RCM_TYPES_AR_RELEASE_MINOR_VERSION) || \
  69. (POWER_IP_RCM_AR_RELEASE_REVISION_VERSION != POWER_IP_RCM_TYPES_AR_RELEASE_REVISION_VERSION) \
  70. )
  71. #error "AutoSar Version Numbers of Power_Ip_RCM.h and Power_Ip_RCM_Types.h are different"
  72. #endif
  73. /* Check if Power_Ip_RCM.h file and Power_Ip_RCM_Types.h file are of the same Software version */
  74. #if ((POWER_IP_RCM_SW_MAJOR_VERSION != POWER_IP_RCM_TYPES_SW_MAJOR_VERSION) || \
  75. (POWER_IP_RCM_SW_MINOR_VERSION != POWER_IP_RCM_TYPES_SW_MINOR_VERSION) || \
  76. (POWER_IP_RCM_SW_PATCH_VERSION != POWER_IP_RCM_TYPES_SW_PATCH_VERSION) \
  77. )
  78. #error "Software Version Numbers of Power_Ip_RCM.h and Power_Ip_RCM_Types.h are different"
  79. #endif
  80. /* Check if Power_Ip_RCM.h file and Power_Ip_Cfg.h file are of the same vendor */
  81. #if (POWER_IP_RCM_VENDOR_ID != POWER_IP_CFG_VENDOR_ID)
  82. #error "Power_Ip_RCM.h and Power_Ip_Cfg.h have different vendor ids"
  83. #endif
  84. /* Check if Power_Ip_RCM.h file and Power_Ip_Cfg.h file are of the same Autosar version */
  85. #if ((POWER_IP_RCM_AR_RELEASE_MAJOR_VERSION != POWER_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \
  86. (POWER_IP_RCM_AR_RELEASE_MINOR_VERSION != POWER_IP_CFG_AR_RELEASE_MINOR_VERSION) || \
  87. (POWER_IP_RCM_AR_RELEASE_REVISION_VERSION != POWER_IP_CFG_AR_RELEASE_REVISION_VERSION) \
  88. )
  89. #error "AutoSar Version Numbers of Power_Ip_RCM.h and Power_Ip_Cfg.h are different"
  90. #endif
  91. /* Check if Power_Ip_RCM.h file and Power_Ip_Cfg.h file are of the same Software version */
  92. #if ((POWER_IP_RCM_SW_MAJOR_VERSION != POWER_IP_CFG_SW_MAJOR_VERSION) || \
  93. (POWER_IP_RCM_SW_MINOR_VERSION != POWER_IP_CFG_SW_MINOR_VERSION) || \
  94. (POWER_IP_RCM_SW_PATCH_VERSION != POWER_IP_CFG_SW_PATCH_VERSION) \
  95. )
  96. #error "Software Version Numbers of Power_Ip_RCM.h and Power_Ip_Cfg.h are different"
  97. #endif
  98. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  99. /* Check if Power_Ip_RCM.h file and StandardTypes.h file are of the same Autosar version */
  100. #if ((POWER_IP_RCM_AR_RELEASE_MAJOR_VERSION != STD_AR_RELEASE_MAJOR_VERSION) || \
  101. (POWER_IP_RCM_AR_RELEASE_MINOR_VERSION != STD_AR_RELEASE_MINOR_VERSION))
  102. #error "AutoSar Version Numbers of Power_Ip_RCM.h and StandardTypes.h are different"
  103. #endif
  104. /* Check if Power_Ip_RCM.h file and Mcal.h file are of the same Autosar version */
  105. #if ((POWER_IP_RCM_AR_RELEASE_MAJOR_VERSION != MCAL_AR_RELEASE_MAJOR_VERSION) || \
  106. (POWER_IP_RCM_AR_RELEASE_MINOR_VERSION != MCAL_AR_RELEASE_MINOR_VERSION))
  107. #error "AutoSar Version Numbers of Power_Ip_RCM.h and Mcal.h are different"
  108. #endif
  109. #endif
  110. /*==================================================================================================
  111. * CONSTANTS
  112. ==================================================================================================*/
  113. /*==================================================================================================
  114. DEFINES AND MACROS
  115. ==================================================================================================*/
  116. /*==================================================================================================
  117. * ENUMS
  118. ==================================================================================================*/
  119. /*==================================================================================================
  120. * STRUCTURES AND OTHER TYPEDEFS
  121. ==================================================================================================*/
  122. /*==================================================================================================
  123. * GLOBAL VARIABLE DECLARATIONS
  124. ==================================================================================================*/
  125. /*==================================================================================================
  126. * FUNCTION PROTOTYPES
  127. ==================================================================================================*/
  128. #define MCU_START_SEC_CODE
  129. #include "Mcu_MemMap.h"
  130. #if (MCU_ENTER_LOW_POWER_MODE == STD_ON)
  131. #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
  132. #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
  133. #define Call_Power_Ip_RCM_SystemResetIsrConfig() \
  134. OsIf_Trusted_Call(Power_Ip_RCM_SystemResetIsrConfig)
  135. #else
  136. #define Call_Power_Ip_RCM_SystemResetIsrConfig() \
  137. Power_Ip_RCM_SystemResetIsrConfig()
  138. #endif
  139. #endif /* POWER_IP_ENABLE_USER_MODE_SUPPORT */
  140. #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
  141. #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
  142. #define Call_Power_Ip_RCM_RestoreSystemResetIsrConfig(u32SystemResetIsrConfig) \
  143. OsIf_Trusted_Call1param(Power_Ip_RCM_RestoreSystemResetIsrConfig,(u32SystemResetIsrConfig))
  144. #else
  145. #define Call_Power_Ip_RCM_RestoreSystemResetIsrConfig(u32SystemResetIsrConfig) \
  146. Power_Ip_RCM_RestoreSystemResetIsrConfig(u32SystemResetIsrConfig)
  147. #endif
  148. #endif /* POWER_IP_ENABLE_USER_MODE_SUPPORT */
  149. #endif /* (MCU_ENTER_LOW_POWER_MODE == STD_ON) */
  150. #if (defined(POWER_IP_DISABLE_RCM_INIT) && (STD_OFF == POWER_IP_DISABLE_RCM_INIT))
  151. #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
  152. #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
  153. #define Call_Power_Ip_RCM_ResetInit(RCM_pResetConfigPtr) \
  154. OsIf_Trusted_Call1param(Power_Ip_RCM_ResetInit,(RCM_pResetConfigPtr))
  155. #else
  156. #define Call_Power_Ip_RCM_ResetInit(RCM_pResetConfigPtr) \
  157. Power_Ip_RCM_ResetInit(RCM_pResetConfigPtr)
  158. #endif
  159. #endif /* POWER_IP_ENABLE_USER_MODE_SUPPORT */
  160. #endif
  161. #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
  162. #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
  163. #define Call_Power_Ip_RCM_GetResetReason() \
  164. OsIf_Trusted_Call_Return(Power_Ip_RCM_GetResetReason)
  165. #else
  166. #define Call_Power_Ip_RCM_GetResetReason() \
  167. Power_Ip_RCM_GetResetReason()
  168. #endif
  169. #endif /* POWER_IP_ENABLE_USER_MODE_SUPPORT */
  170. #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
  171. #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
  172. #define Call_Power_Ip_RCM_GetResetRawValue() \
  173. OsIf_Trusted_Call_Return(Power_Ip_RCM_GetResetRawValue)
  174. #else
  175. #define Call_Power_Ip_RCM_GetResetRawValue() \
  176. Power_Ip_RCM_GetResetRawValue()
  177. #endif
  178. #endif /* POWER_IP_ENABLE_USER_MODE_SUPPORT */
  179. #if (defined(POWER_IP_DISABLE_RCM_INIT) && (STD_OFF == POWER_IP_DISABLE_RCM_INIT))
  180. void Power_Ip_RCM_ResetInit(const Power_Ip_RCM_ConfigType * RCM_pConfigPtr);
  181. #endif
  182. uint32 Power_Ip_RCM_GetResetReason(void);
  183. Power_Ip_RawResetType Power_Ip_RCM_GetResetRawValue(void);
  184. #if (defined(POWER_IP_RESET_ALTERNATE_ISR_USED))
  185. #if (POWER_IP_RESET_ALTERNATE_ISR_USED == STD_ON)
  186. void Power_Ip_RCM_ResetAltInt(void);
  187. #endif /* (POWER_IP_RESET_ALTERNATE_ISR_USED == STD_ON) */
  188. #endif
  189. #if (MCU_ENTER_LOW_POWER_MODE == STD_ON)
  190. uint32 Power_Ip_RCM_GetCurrentSystemResetIsrSettings(void);
  191. void Power_Ip_RCM_SystemResetIsrConfig(void);
  192. void Power_Ip_RCM_RestoreSystemResetIsrConfig(uint32 u32SystemResetIsrConfig);
  193. #endif
  194. #define MCU_STOP_SEC_CODE
  195. #include "Mcu_MemMap.h"
  196. #ifdef __cplusplus
  197. }
  198. #endif
  199. #endif /* POWER_IP_RCM_H */
  200. /** @} */