Power_Ip_Private.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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_Private.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_PRIVATE_H
  35. #define POWER_IP_PRIVATE_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_Types.h"
  46. #include "Power_Ip_Cfg.h"
  47. #ifdef POWER_IP_DEV_ERROR_DETECT
  48. #if (STD_ON == POWER_IP_DEV_ERROR_DETECT)
  49. #include "Devassert.h"
  50. #endif /* (STD_ON == POWER_IP_DEV_ERROR_DETECT) */
  51. #endif /* #ifdef POWER_IP_DEV_ERROR_DETECT */
  52. /*==================================================================================================
  53. SOURCE FILE VERSION INFORMATION
  54. ==================================================================================================*/
  55. #define POWER_IP_PRIVATE_VENDOR_ID 43
  56. #define POWER_IP_PRIVATE_AR_RELEASE_MAJOR_VERSION 4
  57. #define POWER_IP_PRIVATE_AR_RELEASE_MINOR_VERSION 4
  58. #define POWER_IP_PRIVATE_AR_RELEASE_REVISION_VERSION 0
  59. #define POWER_IP_PRIVATE_SW_MAJOR_VERSION 1
  60. #define POWER_IP_PRIVATE_SW_MINOR_VERSION 0
  61. #define POWER_IP_PRIVATE_SW_PATCH_VERSION 0
  62. /*==================================================================================================
  63. FILE VERSION CHECKS
  64. ==================================================================================================*/
  65. /* Check if Power_Ip_Private.h file and Power_Ip_Types.h file have same versions */
  66. #if (POWER_IP_PRIVATE_VENDOR_ID != POWER_IP_TYPES_VENDOR_ID)
  67. #error "Power_Ip_Private.h and Power_Ip_Types.h have different vendor IDs"
  68. #endif
  69. /* Check if Power_Ip_Private.h file and Power_Ip_Types.h file are of the same Autosar version */
  70. #if ((POWER_IP_PRIVATE_AR_RELEASE_MAJOR_VERSION != POWER_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  71. (POWER_IP_PRIVATE_AR_RELEASE_MINOR_VERSION != POWER_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \
  72. (POWER_IP_PRIVATE_AR_RELEASE_REVISION_VERSION != POWER_IP_TYPES_AR_RELEASE_REVISION_VERSION))
  73. #error "AutoSar Version Numbers of Power_Ip_Private.h and Power_Ip_Types.h are different"
  74. #endif
  75. /* Check if Power_Ip_Private.h file and Power_Ip_Types.h file are of the same Software version */
  76. #if ((POWER_IP_PRIVATE_SW_MAJOR_VERSION != POWER_IP_TYPES_SW_MAJOR_VERSION) || \
  77. (POWER_IP_PRIVATE_SW_MINOR_VERSION != POWER_IP_TYPES_SW_MINOR_VERSION) || \
  78. (POWER_IP_PRIVATE_SW_PATCH_VERSION != POWER_IP_TYPES_SW_PATCH_VERSION))
  79. #error "Software Version Numbers of Power_Ip_Private.h and Power_Ip_Types.h are different"
  80. #endif
  81. /* Check if Power_Ip_Private.h file and Power_Ip_Cfg.h file have same versions */
  82. #if (POWER_IP_PRIVATE_VENDOR_ID != POWER_IP_CFG_VENDOR_ID)
  83. #error "Power_Ip_Private.h and Power_Ip_Cfg.h have different vendor IDs"
  84. #endif
  85. /* Check if Power_Ip_Private.h file and Power_Ip_Cfg.h file are of the same Autosar version */
  86. #if ((POWER_IP_PRIVATE_AR_RELEASE_MAJOR_VERSION != POWER_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \
  87. (POWER_IP_PRIVATE_AR_RELEASE_MINOR_VERSION != POWER_IP_CFG_AR_RELEASE_MINOR_VERSION) || \
  88. (POWER_IP_PRIVATE_AR_RELEASE_REVISION_VERSION != POWER_IP_CFG_AR_RELEASE_REVISION_VERSION))
  89. #error "AutoSar Version Numbers of Power_Ip_Private.h and Power_Ip_Cfg.h are different"
  90. #endif
  91. /* Check if Power_Ip_Private.h file and Power_Ip_Cfg.h file are of the same Software version */
  92. #if ((POWER_IP_PRIVATE_SW_MAJOR_VERSION != POWER_IP_CFG_SW_MAJOR_VERSION) || \
  93. (POWER_IP_PRIVATE_SW_MINOR_VERSION != POWER_IP_CFG_SW_MINOR_VERSION) || \
  94. (POWER_IP_PRIVATE_SW_PATCH_VERSION != POWER_IP_CFG_SW_PATCH_VERSION))
  95. #error "Software Version Numbers of Power_Ip_Private.h and Power_Ip_Cfg.h are different"
  96. #endif
  97. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  98. #ifdef POWER_IP_DEV_ERROR_DETECT
  99. #if (STD_ON == POWER_IP_DEV_ERROR_DETECT)
  100. /* Check if Power_Ip_Private.h file and Devassert.h file are of the same Autosar version */
  101. #if ((POWER_IP_PRIVATE_AR_RELEASE_MAJOR_VERSION != DEVASSERT_AR_RELEASE_MAJOR_VERSION) || \
  102. (POWER_IP_PRIVATE_AR_RELEASE_MINOR_VERSION != DEVASSERT_AR_RELEASE_MINOR_VERSION))
  103. #error "AutoSar Version Numbers of Power_Ip_Private.h and Devassert.h are different"
  104. #endif
  105. #endif /* (STD_ON == POWER_IP_DEV_ERROR_DETECT) */
  106. #endif /* #ifdef POWER_IP_DEV_ERROR_DETECT */
  107. #endif
  108. /*==================================================================================================
  109. * CONSTANTS
  110. ==================================================================================================*/
  111. /*==================================================================================================
  112. DEFINES AND MACROS
  113. ==================================================================================================*/
  114. #ifdef POWER_IP_DEV_ERROR_DETECT
  115. #if (POWER_IP_DEV_ERROR_DETECT == STD_ON)
  116. #define POWER_DEV_ASSERT(x) DevAssert(x)
  117. #else
  118. #define POWER_DEV_ASSERT(x)
  119. #endif
  120. #else
  121. #define POWER_DEV_ASSERT(x)
  122. #endif
  123. /*==================================================================================================
  124. * ENUMS
  125. ==================================================================================================*/
  126. /*==================================================================================================
  127. * STRUCTURES AND OTHER TYPEDEFS
  128. ==================================================================================================*/
  129. /*==================================================================================================
  130. * GLOBAL VARIABLE DECLARATIONS
  131. ==================================================================================================*/
  132. /*==================================================================================================
  133. LOCAL VARIABLES
  134. ==================================================================================================*/
  135. #define MCU_START_SEC_VAR_INIT_UNSPECIFIED
  136. #include "Mcu_MemMap.h"
  137. /* Power Report Error Callback */
  138. extern Power_Ip_ReportErrorsCallbackType powerReportErrorsCallback;
  139. #define MCU_STOP_SEC_VAR_INIT_UNSPECIFIED
  140. #include "Mcu_MemMap.h"
  141. /*==================================================================================================
  142. * FUNCTION PROTOTYPES
  143. ==================================================================================================*/
  144. #define MCU_START_SEC_CODE
  145. #include "Mcu_MemMap.h"
  146. void ReportPowerErrors(Power_Ip_PowerReportErrorType error, uint8 u8ErrorCode);
  147. void ReportPowerErrorsEmptyCallback(Power_Ip_PowerReportErrorType error, uint8 u8ErrorCode);
  148. /*!
  149. * @brief Initializes a starting reference point for timeout
  150. *
  151. * @param[out] startTimeOut The starting time from which elapsed time is measured
  152. * @param[out] elapsedTimeOut The elapsed time to be passed to PowerTimeoutExpired
  153. * @param[out] timeoutTicksOut The timeout value (in ticks) to be passed to PowerTimeoutExpired
  154. * @param[in] timeoutUs The timeout value (in microseconds)
  155. */
  156. void PowerStartTimeout(uint32 *startTimeOut,
  157. uint32 *elapsedTimeOut,
  158. uint32 *timeoutTicksOut,
  159. uint32 timeoutUs);
  160. /*!
  161. * @brief Checks for timeout condition.
  162. *
  163. * @param[in,out] startTimeInOut The starting time from which elapsed time is measured
  164. * @param[in,out] elapsedTimeInOut The accumulated elapsed time from the starting time reference
  165. * @param[in] TimeoutTicks The timeout limit (in ticks)
  166. */
  167. boolean PowerTimeoutExpired(uint32 *startTimeInOut,
  168. uint32 *elapsedTimeInOut,
  169. uint32 TimeoutTicks);
  170. #define MCU_STOP_SEC_CODE
  171. #include "Mcu_MemMap.h"
  172. #ifdef __cplusplus
  173. }
  174. #endif
  175. #endif /* POWER_IP_PRIVATE_H */
  176. /** @} */