Mcu_IPW.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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 Mcu_IPW.h
  26. * @implements Mcu_IPW.h_Artifact
  27. * @version 1.0.0
  28. *
  29. * @brief AUTOSAR Mcu - Mcu driver header file.
  30. * @details AUTOSAR specific Mcu driver header file.
  31. * @addtogroup MCU_DRIVER Mcu Driver
  32. * @{
  33. */
  34. #ifndef MCU_IPW_H
  35. #define MCU_IPW_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 "Mcu_IPW_Types.h"
  46. #include "Mcu_EnvCfg.h"
  47. #include "Mcal.h"
  48. /*==================================================================================================
  49. SOURCE FILE VERSION INFORMATION
  50. ==================================================================================================*/
  51. #define MCU_IPW_VENDOR_ID 43
  52. #define MCU_IPW_AR_RELEASE_MAJOR_VERSION 4
  53. #define MCU_IPW_AR_RELEASE_MINOR_VERSION 4
  54. #define MCU_IPW_AR_RELEASE_REVISION_VERSION 0
  55. #define MCU_IPW_SW_MAJOR_VERSION 1
  56. #define MCU_IPW_SW_MINOR_VERSION 0
  57. #define MCU_IPW_SW_PATCH_VERSION 0
  58. /*==================================================================================================
  59. * FILE VERSION CHECKS
  60. ==================================================================================================*/
  61. /* Check if Mcu_IPW.h file and Mcu_IPW_Types.h file are of the same vendor */
  62. #if (MCU_IPW_VENDOR_ID != MCU_IPW_TYPES_VENDOR_ID)
  63. #error "Mcu_IPW.h and Mcu_IPW_Types.h have different vendor ids"
  64. #endif
  65. /* Check if Mcu_IPW.h file and Mcu_IPW_Types.h file are of the same Autosar version */
  66. #if ((MCU_IPW_AR_RELEASE_MAJOR_VERSION != MCU_IPW_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  67. (MCU_IPW_AR_RELEASE_MINOR_VERSION != MCU_IPW_TYPES_AR_RELEASE_MINOR_VERSION) || \
  68. (MCU_IPW_AR_RELEASE_REVISION_VERSION != MCU_IPW_TYPES_AR_RELEASE_REVISION_VERSION) \
  69. )
  70. #error "AutoSar Version Numbers of Mcu_IPW.h and Mcu_IPW_Types.h are different"
  71. #endif
  72. /* Check if Mcu_IPW.h file and Mcu_IPW_Types.h file are of the same Software version */
  73. #if ((MCU_IPW_SW_MAJOR_VERSION != MCU_IPW_TYPES_SW_MAJOR_VERSION) || \
  74. (MCU_IPW_SW_MINOR_VERSION != MCU_IPW_TYPES_SW_MINOR_VERSION) || \
  75. (MCU_IPW_SW_PATCH_VERSION != MCU_IPW_TYPES_SW_PATCH_VERSION) \
  76. )
  77. #error "Software Version Numbers of Mcu_IPW.h and Mcu_IPW_Types.h are different"
  78. #endif
  79. /* Check if Mcu_IPW.h file and Mcu_EnvCfg.h file are of the same vendor */
  80. #if (MCU_IPW_VENDOR_ID != MCU_ENVCFG_VENDOR_ID)
  81. #error "Mcu_IPW.h and Mcu_EnvCfg.h have different vendor ids"
  82. #endif
  83. /* Check if Mcu_IPW.h file and Mcu_EnvCfg.h file are of the same Autosar version */
  84. #if ((MCU_IPW_AR_RELEASE_MAJOR_VERSION != MCU_ENVCFG_AR_RELEASE_MAJOR_VERSION) || \
  85. (MCU_IPW_AR_RELEASE_MINOR_VERSION != MCU_ENVCFG_AR_RELEASE_MINOR_VERSION) || \
  86. (MCU_IPW_AR_RELEASE_REVISION_VERSION != MCU_ENVCFG_AR_RELEASE_REVISION_VERSION) \
  87. )
  88. #error "AutoSar Version Numbers of Mcu_IPW.h and Mcu_EnvCfg.h are different"
  89. #endif
  90. /* Check if Mcu_IPW.h file and Mcu_EnvCfg.h file are of the same Software version */
  91. #if ((MCU_IPW_SW_MAJOR_VERSION != MCU_ENVCFG_SW_MAJOR_VERSION) || \
  92. (MCU_IPW_SW_MINOR_VERSION != MCU_ENVCFG_SW_MINOR_VERSION) || \
  93. (MCU_IPW_SW_PATCH_VERSION != MCU_ENVCFG_SW_PATCH_VERSION) \
  94. )
  95. #error "Software Version Numbers of Mcu_IPW.h and Mcu_EnvCfg.h are different"
  96. #endif
  97. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  98. /* Check if Mcu_IPW.h file and Mcal.h file are of the same Autosar version */
  99. #if ((MCU_IPW_AR_RELEASE_MAJOR_VERSION != MCAL_AR_RELEASE_MAJOR_VERSION) || \
  100. (MCU_IPW_AR_RELEASE_MINOR_VERSION != MCAL_AR_RELEASE_MINOR_VERSION))
  101. #error "AutoSar Version Numbers of Mcu_IPW.h and Mcal.h are different"
  102. #endif
  103. #endif
  104. /*==================================================================================================
  105. CONSTANTS
  106. ==================================================================================================*/
  107. /*==================================================================================================
  108. DEFINES AND MACROS
  109. ==================================================================================================*/
  110. #ifdef MCU_EMIOS_CONFIGURE_GPREN_API
  111. #if (MCU_EMIOS_CONFIGURE_GPREN_API == STD_ON)
  112. #define MCU_EMIOS_GPREN_BIT_ENABLE (0x01U)
  113. #define MCU_EMIOS_GPREN_BIT_DISABLE (0x00U)
  114. #define MCU_EMIOS_MCR_GPREN_MASK32 eMIOS_MCR_GPREN_MASK
  115. #endif
  116. #endif
  117. #if (MCU_INIT_CLOCK == STD_ON)
  118. /* When clock_ip notifications are enabled, then callback is install to receive notifications.
  119. */
  120. #if (\
  121. (defined(MCU_DISABLE_DEM_REPORT_ERROR_STATUS) && (MCU_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)) || \
  122. (defined(MCU_DISABLE_RAM_CONFIG) && (MCU_DISABLE_RAM_CONFIG == STD_OFF)) || \
  123. (defined(MCU_DISABLE_FLASH_CONFIG) && (MCU_DISABLE_FLASH_CONFIG == STD_OFF)) || \
  124. (defined(MCU_CMU_ERROR_ISR_USED) && (MCU_CMU_ERROR_ISR_USED == STD_ON)) || \
  125. defined(MCU_ERROR_ISR_NOTIFICATION) \
  126. )
  127. #define CLOCK_IP_ENABLE_NOTIFICATIONS STD_ON
  128. #else
  129. #define CLOCK_IP_ENABLE_NOTIFICATIONS STD_OFF
  130. #endif
  131. #else
  132. #define CLOCK_IP_ENABLE_NOTIFICATIONS STD_OFF
  133. #endif /* (MCU_INIT_CLOCK == STD_ON) */
  134. #if (\
  135. (defined(MCU_DISABLE_DEM_REPORT_ERROR_STATUS) && (MCU_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)) || \
  136. (defined(MCU_ERROR_ISR_NOTIFICATION)) || \
  137. (defined(MCU_PMC_NOTIFICATION)) || \
  138. (defined(POWER_IP_REPORT_VLPSA_NOTIFICATION)) \
  139. )
  140. #define POWER_IP_ENABLE_NOTIFICATIONS STD_ON
  141. #else
  142. #define POWER_IP_ENABLE_NOTIFICATIONS STD_OFF
  143. #endif
  144. /*==================================================================================================
  145. ENUMS
  146. ==================================================================================================*/
  147. /*==================================================================================================
  148. STRUCTURES AND OTHER TYPEDEFS
  149. ==================================================================================================*/
  150. /*==================================================================================================
  151. GLOBAL VARIABLE DECLARATIONS
  152. ==================================================================================================*/
  153. /*==================================================================================================
  154. FUNCTION PROTOTYPES
  155. ==================================================================================================*/
  156. #define MCU_START_SEC_CODE
  157. #include "Mcu_MemMap.h"
  158. void Mcu_Ipw_Init(const Mcu_HwIPsConfigType * Mcu_pHwIPsConfigPtr);
  159. void Mcu_Ipw_SetMode(const Mcu_ModeConfigType * Mcu_pModeConfigPtr);
  160. #ifndef MCU_MAX_NORAMCONFIGS
  161. Std_ReturnType Mcu_Ipw_InitRamSection(const Mcu_RamConfigType * Mcu_pRamConfigPtr);
  162. #endif /* ifndef MCU_MAX_NORAMCONFIGS */
  163. #if (MCU_INIT_CLOCK == STD_ON)
  164. void Mcu_Ipw_InitClock(const Mcu_ClockConfigType * Mcu_pClockConfigPtr);
  165. #endif /* (MCU_INIT_CLOCK == STD_ON) */
  166. #if (MCU_INIT_CLOCK == STD_ON)
  167. #if (MCU_NO_PLL == STD_OFF)
  168. void Mcu_Ipw_DistributePllClock(void);
  169. #endif /* (MCU_NO_PLL == STD_OFF) */
  170. #endif /* (MCU_INIT_CLOCK == STD_ON) */
  171. #if (MCU_NO_PLL == STD_OFF)
  172. Mcu_PllStatusType Mcu_Ipw_GetPllStatus(void);
  173. #endif /* (MCU_NO_PLL == STD_OFF) */
  174. #if MCU_PERFORM_RESET_API == STD_ON
  175. void Mcu_Ipw_PerformReset(const Mcu_HwIPsConfigType * Mcu_pHwIPsConfigPtr);
  176. #endif /* (MCU_PERFORM_RESET_API == STD_ON) */
  177. Mcu_ResetType Mcu_Ipw_GetResetReason(void);
  178. Mcu_RawResetType Mcu_Ipw_GetResetRawValue(void);
  179. #if (MCU_GET_RAM_STATE_API == STD_ON)
  180. Mcu_RamStateType Mcu_Ipw_GetRamState(void);
  181. #endif /* (MCU_GET_RAM_STATE_API == STD_ON) */
  182. #if (MCU_POWERMODE_STATE_API == STD_ON)
  183. Mcu_PowerModeStateType Mcu_Ipw_GetPowerModeState(void);
  184. #endif /* (MCU_POWERMODE_STATE_API == STD_ON) */
  185. #if (MCU_GET_POWER_DOMAIN_API == STD_ON)
  186. Std_ReturnType Mcu_Ipw_GetPowerDomainState(void);
  187. #endif /* (MCU_GET_POWER_DOMAIN_API == STD_ON) */
  188. #if (MCU_GET_MIDR_API == STD_ON)
  189. void Mcu_Ipw_GetMidrStructure(Mcu_MidrReturnType * pMidr);
  190. #endif /*(MCU_GET_MIDR_API == STD_ON)*/
  191. #ifdef MCU_DISABLE_CMU_API
  192. #if (MCU_DISABLE_CMU_API == STD_ON)
  193. void Mcu_Ipw_DisableCmu(Clock_Ip_NameType clockName);
  194. #endif
  195. #endif
  196. #ifdef MCU_EMIOS_CONFIGURE_GPREN_API
  197. #if (MCU_EMIOS_CONFIGURE_GPREN_API == STD_ON)
  198. void Mcu_Ipw_EmiosConfigureGpren(uint8 u8Module, uint8 u8Value);
  199. #endif
  200. #endif
  201. #ifdef MCU_GET_CLOCK_FREQUENCY_API
  202. #if (MCU_GET_CLOCK_FREQUENCY_API == STD_ON)
  203. uint32 MCU_Ipw_GetClockFrequency(Clock_Ip_NameType clockName);
  204. #endif /* (MCU_GET_CLOCK_FREQUENCY_API == STD_ON) */
  205. #endif /* MCU_GET_CLOCK_FREQUENCY_API */
  206. #ifdef MCU_SLEEPONEXIT_SUPPORT
  207. #if (MCU_SLEEPONEXIT_SUPPORT == STD_ON)
  208. void Mcu_Ipw_SleepOnExit(Mcu_SleepOnExitType SleepOnExit);
  209. #endif
  210. #endif
  211. #ifdef MCU_SRAM_RETEN_CONFIG_API
  212. #if (MCU_SRAM_RETEN_CONFIG_API == STD_ON)
  213. /**
  214. * @brief Configuration for SRAM retention.
  215. *
  216. * @details This function configure for both SRAML_RETEN and SRAMU_RETEN bits.
  217. *
  218. * @return void
  219. */
  220. void Mcu_Ipw_SRAMRetentionConfig(Mcu_SRAMRetenConfigType eSRAMRetenConfig);
  221. #endif
  222. #endif
  223. #define MCU_STOP_SEC_CODE
  224. #include "Mcu_MemMap.h"
  225. #ifdef __cplusplus
  226. }
  227. #endif
  228. #endif /* MCU_IPW_H */
  229. /** @} */