Power_Ip.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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.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_H
  35. #define POWER_IP_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 "Mcal.h"
  46. #include "Power_Ip_Types.h"
  47. #include "Power_Ip_Cfg.h"
  48. /*==================================================================================================
  49. SOURCE FILE VERSION INFORMATION
  50. ==================================================================================================*/
  51. #define POWER_IP_VENDOR_ID 43
  52. #define POWER_IP_AR_RELEASE_MAJOR_VERSION 4
  53. #define POWER_IP_AR_RELEASE_MINOR_VERSION 4
  54. #define POWER_IP_AR_RELEASE_REVISION_VERSION 0
  55. #define POWER_IP_SW_MAJOR_VERSION 1
  56. #define POWER_IP_SW_MINOR_VERSION 0
  57. #define POWER_IP_SW_PATCH_VERSION 0
  58. /*==================================================================================================
  59. FILE VERSION CHECKS
  60. ==================================================================================================*/
  61. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  62. /* Check if Power_Ip.h header file and Mcal.h header file are of the same Autosar version */
  63. #if ((POWER_IP_AR_RELEASE_MAJOR_VERSION != MCAL_AR_RELEASE_MAJOR_VERSION) || \
  64. (POWER_IP_AR_RELEASE_MINOR_VERSION != MCAL_AR_RELEASE_MINOR_VERSION))
  65. #error "AutoSar Version Numbers of Power_Ip.h and Mcal.h are different"
  66. #endif
  67. #endif
  68. /* Check if Power_Ip.h file and Power_Ip_Types.h file have same versions */
  69. #if (POWER_IP_VENDOR_ID != POWER_IP_TYPES_VENDOR_ID)
  70. #error "Power_Ip.h and Power_Ip_Types.h have different vendor IDs"
  71. #endif
  72. /* Check if Power_Ip.h file and Power_Ip_Types.h file are of the same Autosar version */
  73. #if ((POWER_IP_AR_RELEASE_MAJOR_VERSION != POWER_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  74. (POWER_IP_AR_RELEASE_MINOR_VERSION != POWER_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \
  75. (POWER_IP_AR_RELEASE_REVISION_VERSION != POWER_IP_TYPES_AR_RELEASE_REVISION_VERSION))
  76. #error "AutoSar Version Numbers of Power_Ip.h and Power_Ip_Types.h are different"
  77. #endif
  78. /* Check if Power_Ip.h file and Power_Ip_Types.h file are of the same Software version */
  79. #if ((POWER_IP_SW_MAJOR_VERSION != POWER_IP_TYPES_SW_MAJOR_VERSION) || \
  80. (POWER_IP_SW_MINOR_VERSION != POWER_IP_TYPES_SW_MINOR_VERSION) || \
  81. (POWER_IP_SW_PATCH_VERSION != POWER_IP_TYPES_SW_PATCH_VERSION))
  82. #error "Software Version Numbers of Power_Ip.h and Power_Ip_Types.h are different"
  83. #endif
  84. /* Check if Power_Ip.h file and Power_Ip_Cfg.h file have same versions */
  85. #if (POWER_IP_VENDOR_ID != POWER_IP_CFG_VENDOR_ID)
  86. #error "Power_Ip.h and Power_Ip_Cfg.h have different vendor IDs"
  87. #endif
  88. /* Check if Power_Ip.h file and Power_Ip_Cfg.h file are of the same Autosar version */
  89. #if ((POWER_IP_AR_RELEASE_MAJOR_VERSION != POWER_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \
  90. (POWER_IP_AR_RELEASE_MINOR_VERSION != POWER_IP_CFG_AR_RELEASE_MINOR_VERSION) || \
  91. (POWER_IP_AR_RELEASE_REVISION_VERSION != POWER_IP_CFG_AR_RELEASE_REVISION_VERSION))
  92. #error "AutoSar Version Numbers of Power_Ip.h and Power_Ip_Cfg.h are different"
  93. #endif
  94. /* Check if Power_Ip.h file and Power_Ip_Cfg.h file are of the same Software version */
  95. #if ((POWER_IP_SW_MAJOR_VERSION != POWER_IP_CFG_SW_MAJOR_VERSION) || \
  96. (POWER_IP_SW_MINOR_VERSION != POWER_IP_CFG_SW_MINOR_VERSION) || \
  97. (POWER_IP_SW_PATCH_VERSION != POWER_IP_CFG_SW_PATCH_VERSION))
  98. #error "Software Version Numbers of Power_Ip.h and Power_Ip_Cfg.h are different"
  99. #endif
  100. #if 0
  101. /* Check if Power_Ip.h file and Power_Ip_CortexM7.h file have same versions */
  102. #if (POWER_IP_VENDOR_ID != POWER_IP_CORTEXM7_VENDOR_ID)
  103. #error "Power_Ip.h and Power_Ip_CortexM7.h have different vendor IDs"
  104. #endif
  105. /* Check if Power_Ip.h file and Power_Ip_CortexM7.h file are of the same Autosar version */
  106. #if ((POWER_IP_AR_RELEASE_MAJOR_VERSION != POWER_IP_CORTEXM7_AR_RELEASE_MAJOR_VERSION) || \
  107. (POWER_IP_AR_RELEASE_MINOR_VERSION != POWER_IP_CORTEXM7_AR_RELEASE_MINOR_VERSION) || \
  108. (POWER_IP_AR_RELEASE_REVISION_VERSION != POWER_IP_CORTEXM7_AR_RELEASE_REVISION_VERSION))
  109. #error "AutoSar Version Numbers of Power_Ip.h and Power_Ip_CortexM7.h are different"
  110. #endif
  111. /* Check if Power_Ip.h file and Power_Ip_CortexM7.h file are of the same Software version */
  112. #if ((POWER_IP_SW_MAJOR_VERSION != POWER_IP_CORTEXM7_SW_MAJOR_VERSION) || \
  113. (POWER_IP_SW_MINOR_VERSION != POWER_IP_CORTEXM7_SW_MINOR_VERSION) || \
  114. (POWER_IP_SW_PATCH_VERSION != POWER_IP_CORTEXM7_SW_PATCH_VERSION))
  115. #error "Software Version Numbers of Power_Ip.h and Power_Ip_CortexM7.h are different"
  116. #endif
  117. #endif
  118. /*==================================================================================================
  119. * CONSTANTS
  120. ==================================================================================================*/
  121. /*==================================================================================================
  122. DEFINES AND MACROS
  123. ==================================================================================================*/
  124. /*==================================================================================================
  125. * ENUMS
  126. ==================================================================================================*/
  127. /*==================================================================================================
  128. * STRUCTURES AND OTHER TYPEDEFS
  129. ==================================================================================================*/
  130. /*==================================================================================================
  131. GLOBAL VARIABLE DECLARATIONS
  132. ==================================================================================================*/
  133. /*==================================================================================================
  134. FUNCTION PROTOTYPES
  135. ==================================================================================================*/
  136. #define MCU_START_SEC_CODE
  137. #include "Mcu_MemMap.h"
  138. #if (defined(POWER_IP_DISABLE_RCM_INIT) && (STD_OFF == POWER_IP_DISABLE_RCM_INIT))
  139. /*!
  140. * @brief Reset initialization
  141. *
  142. * This function reset initialization
  143. *
  144. * @param[in] Power_Ip_pHwIPsConfigPtr reset initialization configuration.
  145. *
  146. * @return void
  147. */
  148. void Power_Ip_InitReset (const Power_Ip_HwIPsConfigType * Power_Ip_pHwIPsConfigPtr);
  149. #endif
  150. /*!
  151. * @brief Power initialization
  152. *
  153. * This function power initialization
  154. *
  155. * @param[in] Power_Ip_pHwIPsConfigPtr power initialization configuration.
  156. *
  157. * @return void
  158. */
  159. void Power_Ip_InitPower (const Power_Ip_HwIPsConfigType * Power_Ip_pHwIPsConfigPtr);
  160. /*!
  161. * @brief Sets mode
  162. *
  163. * This function sets mode.
  164. *
  165. * @param[in] Power_Ip_pHwIPsConfigPtr power set mote configuration.
  166. *
  167. * @return void
  168. */
  169. void Power_Ip_SetMode (const Power_Ip_ModeConfigType * Power_Ip_pModeConfigPtr);
  170. #ifdef POWER_IP_POWERMODE_STATE_API
  171. #if (STD_ON == POWER_IP_POWERMODE_STATE_API)
  172. Power_Ip_PowerModeStateType Power_Ip_GetPowerModeState(void);
  173. #endif
  174. #endif
  175. #if (MCU_PERFORM_RESET_API == STD_ON)
  176. /*!
  177. * @brief Performs reset
  178. *
  179. * This function performs reset.
  180. *
  181. * @param[in] Power_Ip_HwIPsConfigType reset initialization configuration.
  182. *
  183. * @return void
  184. */
  185. void Power_Ip_PerformReset(const Power_Ip_HwIPsConfigType * Power_Ip_pHwIPsConfigPtr);
  186. #endif /* (MCU_PERFORM_RESET_API == STD_ON) */
  187. /*!
  188. * @brief Returns reset type
  189. *
  190. * This function returns reset type.
  191. *
  192. * @return Power_Ip_ResetType Reset type
  193. */
  194. Power_Ip_ResetType Power_Ip_GetResetReason(void);
  195. /*!
  196. * @brief Returns raw reset type
  197. *
  198. * This function returns raw reset type.
  199. *
  200. * @return Power_Ip_RawResetType Raw reset type
  201. */
  202. Power_Ip_RawResetType Power_Ip_GetResetRawValue(void);
  203. /*!
  204. * @brief Install report error callback
  205. *
  206. * This function installs a callback for reporting errors from power driver
  207. *
  208. *
  209. * @param[in] Power_Ip_ReportErrorCallbackType Callback to be installed.
  210. *
  211. * @return void
  212. */
  213. void Power_Ip_InstallNotificationsCallback(Power_Ip_ReportErrorsCallbackType reportErrorsCallback);
  214. #ifdef POWER_IP_SLEEPONEXIT_SUPPORT
  215. #if (POWER_IP_SLEEPONEXIT_SUPPORT == STD_ON)
  216. void Power_Ip_DisableSleepOnExit(void);
  217. void Power_Ip_EnableSleepOnExit(void);
  218. #endif
  219. #endif
  220. #ifdef POWER_IP_SRAM_RETEN_CONFIG_API
  221. #if (POWER_IP_SRAM_RETEN_CONFIG_API == STD_ON)
  222. void Power_Ip_SRAMRetentionConfig(Power_Ip_SRAMRetenConfigType eSRAMRetenConfig);
  223. #endif
  224. #endif
  225. #define MCU_STOP_SEC_CODE
  226. #include "Mcu_MemMap.h"
  227. #ifdef __cplusplus
  228. }
  229. #endif
  230. #endif /* POWER_IP_H */
  231. /** @} */