Power_Ip_Cfg.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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_Cfg.h
  26. * @version 1.0.0
  27. *
  28. * @brief AUTOSAR Mcu - Post-Build(PB) configuration file code template.
  29. * @details Code template for Post-Build(PB) configuration file generation.
  30. *
  31. * @addtogroup POWER_DRIVER_CONFIGURATION Power Ip Driver
  32. * @{
  33. */
  34. #ifndef POWER_IP_CFG_H
  35. #define POWER_IP_CFG_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_VS_0_PBcfg.h"
  46. /*==================================================================================================
  47. * SOURCE FILE VERSION INFORMATION
  48. ==================================================================================================*/
  49. #define POWER_IP_CFG_VENDOR_ID 43
  50. #define POWER_IP_CFG_AR_RELEASE_MAJOR_VERSION 4
  51. #define POWER_IP_CFG_AR_RELEASE_MINOR_VERSION 4
  52. #define POWER_IP_CFG_AR_RELEASE_REVISION_VERSION 0
  53. #define POWER_IP_CFG_SW_MAJOR_VERSION 1
  54. #define POWER_IP_CFG_SW_MINOR_VERSION 0
  55. #define POWER_IP_CFG_SW_PATCH_VERSION 0
  56. /*==================================================================================================
  57. * FILE VERSION CHECKS
  58. ==================================================================================================*/
  59. /* Check if Power_Ip_Cfg.h file and Power_Ip_VS_0_PBcfg.h file are of the same vendor */
  60. #if (POWER_IP_CFG_VENDOR_ID != POWER_IP_VS_0_PBCFG_VENDOR_ID)
  61. #error "Power_Ip_Cfg.h and Power_Ip_VS_0_PBcfg.h have different vendor ids"
  62. #endif
  63. /* Check if Power_Ip_Cfg.h file and Power_Ip_VS_0_PBcfg.h file are of the same Autosar version */
  64. #if ((POWER_IP_CFG_AR_RELEASE_MAJOR_VERSION != POWER_IP_VS_0_PBCFG_AR_RELEASE_MAJOR_VERSION) || \
  65. (POWER_IP_CFG_AR_RELEASE_MINOR_VERSION != POWER_IP_VS_0_PBCFG_AR_RELEASE_MINOR_VERSION) || \
  66. (POWER_IP_CFG_AR_RELEASE_REVISION_VERSION != POWER_IP_VS_0_PBCFG_AR_RELEASE_REVISION_VERSION) \
  67. )
  68. #error "AutoSar Version Numbers of Power_Ip_Cfg.h and Power_Ip_VS_0_PBcfg.h are different"
  69. #endif
  70. /* Check if Power_Ip_Cfg.h file and Power_Ip_VS_0_PBcfg.h file are of the same Software version */
  71. #if ((POWER_IP_CFG_SW_MAJOR_VERSION != POWER_IP_VS_0_PBCFG_SW_MAJOR_VERSION) || \
  72. (POWER_IP_CFG_SW_MINOR_VERSION != POWER_IP_VS_0_PBCFG_SW_MINOR_VERSION) || \
  73. (POWER_IP_CFG_SW_PATCH_VERSION != POWER_IP_VS_0_PBCFG_SW_PATCH_VERSION) \
  74. )
  75. #error "Software Version Numbers of Power_Ip_Cfg.h and Power_Ip_VS_0_PBcfg.h are different"
  76. #endif
  77. /*==================================================================================================
  78. DEFINES AND MACROS
  79. ==================================================================================================*/
  80. #define POWER_IP_DEV_ERROR_DETECT (STD_OFF)
  81. #define POWER_TIMEOUT_TYPE (OSIF_COUNTER_DUMMY)
  82. #define POWER_TIMEOUT_VALUE_US (50000U)
  83. /**
  84. * @brief Support for User mode.
  85. * If this parameter has been configured to 'TRUE' the Clock can be executed from both supervisor and user mode.
  86. */
  87. #define POWER_IP_ENABLE_USER_MODE_SUPPORT (STD_OFF)
  88. /** Check the driver user mode is enabled only when the MCAL_ENABLE_USER_MODE_SUPPORT is enabled */
  89. #ifndef MCAL_ENABLE_USER_MODE_SUPPORT
  90. #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
  91. #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running Clock in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined.
  92. #endif /* (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT) */
  93. #endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT */
  94. /**
  95. * @brief Create defines with the values assigned to Mcu Reset Reason configurations.
  96. * These values can be retrieved from Mcu_GetResetReason Api.
  97. */
  98. #define McuConf_McuResetReasonConf_MCU_STOP_ACKNOWLEDGE_ERROR_RESET ((uint8)0U)
  99. #define McuConf_McuResetReasonConf_MCU_MDM_AP_SYSTEM_RESET ((uint8)1U)
  100. #define McuConf_McuResetReasonConf_MCU_SW_RESET ((uint8)2U)
  101. #define McuConf_McuResetReasonConf_MCU_CORE_LOCKUP_RESET ((uint8)3U)
  102. #define McuConf_McuResetReasonConf_MCU_JTAG_RESET ((uint8)4U)
  103. #define McuConf_McuResetReasonConf_MCU_POWER_ON_RESET ((uint8)5U)
  104. #define McuConf_McuResetReasonConf_MCU_EXTERNAL_PIN_RESET ((uint8)6U)
  105. #define McuConf_McuResetReasonConf_MCU_WATCHDOG_RESET ((uint8)7U)
  106. #define McuConf_McuResetReasonConf_MCU_CMU_LOSS_OF_CLOCK_RESET ((uint8)8U)
  107. #define McuConf_McuResetReasonConf_MCU_LOSS_OF_LOCK_RESET ((uint8)9U)
  108. #define McuConf_McuResetReasonConf_MCU_LOSS_OF_CLOCK_RESET ((uint8)10U)
  109. #define McuConf_McuResetReasonConf_MCU_LOW_OR_HIGH_VOLTAGE_DETECT_RESET ((uint8)11U)
  110. #define McuConf_McuResetReasonConf_MCU_NO_RESET_REASON ((uint8)12U)
  111. #define McuConf_McuResetReasonConf_MCU_MULTIPLE_RESET_REASON ((uint8)13U)
  112. #define McuConf_McuResetReasonConf_MCU_RESET_UNDEFINED ((uint8)14U)
  113. /*==================================================================================================
  114. ENUMS
  115. ==================================================================================================*/
  116. /**
  117. * @brief The type Power_Ip_ResetType, represents the different reset that a specified POWER_IP can have.
  118. * @details The POWER_IP shall provide at least the values MCU_POWER_ON_RESET and MCU_RESET_UNDEFINED for the enumeration Power_Ip_ResetType.
  119. *
  120. * @implements Power_Ip_ResetType_Enumeration
  121. */
  122. typedef enum
  123. {
  124. MCU_STOP_ACKNOWLEDGE_ERROR_RESET = McuConf_McuResetReasonConf_MCU_STOP_ACKNOWLEDGE_ERROR_RESET, /**< @brief Stop Acknowledge Error reset . RCM_SRS[SACKERR]. */
  125. MCU_MDM_AP_SYSTEM_RESET = McuConf_McuResetReasonConf_MCU_MDM_AP_SYSTEM_RESET, /**< @brief MDM-AP System Reset Request . RCM_SRS[MDM_AP]. */
  126. MCU_SW_RESET = McuConf_McuResetReasonConf_MCU_SW_RESET, /**< @brief Software reset . RCM_SRS[SW]. */
  127. MCU_CORE_LOCKUP_RESET = McuConf_McuResetReasonConf_MCU_CORE_LOCKUP_RESET, /**< @brief Core Lockup reset . RCM_SRS[LOCKUP]. */
  128. MCU_JTAG_RESET = McuConf_McuResetReasonConf_MCU_JTAG_RESET, /**< @brief JTAG generated reset . RCM_SRS[JTAG]. */
  129. MCU_POWER_ON_RESET = McuConf_McuResetReasonConf_MCU_POWER_ON_RESET, /**< @brief Power-on reset. RCM_SRS[POR]. */
  130. MCU_EXTERNAL_PIN_RESET = McuConf_McuResetReasonConf_MCU_EXTERNAL_PIN_RESET, /**< @brief External Reset Pin. RCM_SRS[PIN]. */
  131. MCU_WATCHDOG_RESET = McuConf_McuResetReasonConf_MCU_WATCHDOG_RESET, /**< @brief Watchdog reset. RCM_SRS[Watchdog]. */
  132. MCU_CMU_LOSS_OF_CLOCK_RESET = McuConf_McuResetReasonConf_MCU_CMU_LOSS_OF_CLOCK_RESET, /**< @brief CMU Loss-of-Clock Reset. RCM_SRS[CMU_LOC]. */
  133. MCU_LOSS_OF_LOCK_RESET = McuConf_McuResetReasonConf_MCU_LOSS_OF_LOCK_RESET, /**< @brief Loss-of-Lock Reset. RCM_SRS[LOL]. */
  134. MCU_LOSS_OF_CLOCK_RESET = McuConf_McuResetReasonConf_MCU_LOSS_OF_CLOCK_RESET, /**< @brief Loss-of-Clock Reset. RCM_SRS[LOC]. */
  135. MCU_LOW_OR_HIGH_VOLTAGE_DETECT_RESET = McuConf_McuResetReasonConf_MCU_LOW_OR_HIGH_VOLTAGE_DETECT_RESET, /**< @brief Low-Voltage Detect Reset or High-Voltage Detect Reset. RCM_SRS[LVD]. */
  136. MCU_NO_RESET_REASON = McuConf_McuResetReasonConf_MCU_NO_RESET_REASON, /**< @brief No reset reason found */
  137. MCU_MULTIPLE_RESET_REASON = McuConf_McuResetReasonConf_MCU_MULTIPLE_RESET_REASON, /**< @brief More than one reset events are logged except "Power on event" */
  138. MCU_RESET_UNDEFINED = McuConf_McuResetReasonConf_MCU_RESET_UNDEFINED /**< @brief Undefined reset source. */
  139. } Power_Ip_ResetType;
  140. /**
  141. * @brief Type of parameter value of the function Mcu_SRAMRetentionConfig.
  142. * @details The type of Power_Ip_SRAMRetenConfigType is an enumeration with the following values:
  143. * MCU_SRAML_RETEN, MCU_SRAMU_RETEN, MCU_SRAMLU_RETEN, MCU_NO_SRAMLU_RETEN.
  144. */
  145. typedef enum
  146. {
  147. MCU_SRAML_RETEN = (uint32)0x00100000U, /**< @brief SRAML will be retain only. */
  148. MCU_SRAMU_RETEN = (uint32)0x00200000U, /**< @brief SRAMU will be retain only. */
  149. MCU_SRAMLU_RETEN = (uint32)0x00000000U, /**< @brief Both SRAML and SRAMU will be retain. */
  150. MCU_NO_SRAMLU_RETEN = (uint32)0x00300000U, /**< @brief Both SRAML and SRAMU will not be retain. */
  151. } Power_Ip_SRAMRetenConfigType;
  152. #ifdef __cplusplus
  153. }
  154. #endif
  155. #endif /* #ifndef POWER_IP_CFG_H */
  156. /** @} */