Mcu.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  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.h
  26. * @implements Mcu.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_H
  35. #define MCU_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. /**
  46. * @brief Import all data types from lower layers that should be exported.
  47. * Mcu.h shall include Mcu_Cfg.h for the API pre-compiler switches.
  48. *
  49. */
  50. #include "Mcu_Cfg.h"
  51. #include "Mcu_EnvCfg.h"
  52. #include "Mcu_IPW_Types.h"
  53. #include "Mcal.h"
  54. /*==================================================================================================
  55. * SOURCE FILE VERSION INFORMATION
  56. ==================================================================================================*/
  57. #define MCU_VENDOR_ID 43
  58. #define MCU_MODULE_ID 101
  59. #define MCU_AR_RELEASE_MAJOR_VERSION 4
  60. #define MCU_AR_RELEASE_MINOR_VERSION 4
  61. #define MCU_AR_RELEASE_REVISION_VERSION 0
  62. #define MCU_SW_MAJOR_VERSION 1
  63. #define MCU_SW_MINOR_VERSION 0
  64. #define MCU_SW_PATCH_VERSION 0
  65. /*==================================================================================================
  66. FILE VERSION CHECKS
  67. ==================================================================================================*/
  68. /* Check if Mcu.h file and Mcu_Cfg.h file are of the same vendor */
  69. #if (MCU_VENDOR_ID != MCU_CFG_VENDOR_ID)
  70. #error "Mcu.h and Mcu_Cfg.h have different vendor ids"
  71. #endif
  72. /* Check if Mcu.h file and Mcu_Cfg.h file are of the same Autosar version */
  73. #if ((MCU_AR_RELEASE_MAJOR_VERSION != MCU_CFG_AR_RELEASE_MAJOR_VERSION) || \
  74. (MCU_AR_RELEASE_MINOR_VERSION != MCU_CFG_AR_RELEASE_MINOR_VERSION) || \
  75. (MCU_AR_RELEASE_REVISION_VERSION != MCU_CFG_AR_RELEASE_REVISION_VERSION) \
  76. )
  77. #error "AutoSar Version Numbers of Mcu.h and Mcu_Cfg.h are different"
  78. #endif
  79. /* Check if Mcu.h file and Mcu_Cfg.h file are of the same Software version */
  80. #if ((MCU_SW_MAJOR_VERSION != MCU_CFG_SW_MAJOR_VERSION) || \
  81. (MCU_SW_MINOR_VERSION != MCU_CFG_SW_MINOR_VERSION) || \
  82. (MCU_SW_PATCH_VERSION != MCU_CFG_SW_PATCH_VERSION) \
  83. )
  84. #error "Software Version Numbers of Mcu.h and Mcu_Cfg.h are different"
  85. #endif
  86. /* Check if Mcu.h file and Mcu_EnvCfg.h file are of the same vendor */
  87. #if (MCU_VENDOR_ID != MCU_ENVCFG_VENDOR_ID)
  88. #error "Mcu.h and Mcu_EnvCfg.h have different vendor ids"
  89. #endif
  90. /* Check if Mcu.h file and Mcu_EnvCfg.h file are of the same Autosar version */
  91. #if ((MCU_AR_RELEASE_MAJOR_VERSION != MCU_ENVCFG_AR_RELEASE_MAJOR_VERSION) || \
  92. (MCU_AR_RELEASE_MINOR_VERSION != MCU_ENVCFG_AR_RELEASE_MINOR_VERSION) || \
  93. (MCU_AR_RELEASE_REVISION_VERSION != MCU_ENVCFG_AR_RELEASE_REVISION_VERSION) \
  94. )
  95. #error "AutoSar Version Numbers of Mcu.h and Mcu_EnvCfg.h are different"
  96. #endif
  97. /* Check if Mcu.h file and Mcu_EnvCfg.h file are of the same Software version */
  98. #if ((MCU_SW_MAJOR_VERSION != MCU_ENVCFG_SW_MAJOR_VERSION) || \
  99. (MCU_SW_MINOR_VERSION != MCU_ENVCFG_SW_MINOR_VERSION) || \
  100. (MCU_SW_PATCH_VERSION != MCU_ENVCFG_SW_PATCH_VERSION) \
  101. )
  102. #error "Software Version Numbers of Mcu.h and Mcu_EnvCfg.h are different"
  103. #endif
  104. /* Check if Mcu.h file and Mcu_IPW_Types.h file are of the same vendor */
  105. #if (MCU_VENDOR_ID != MCU_IPW_TYPES_VENDOR_ID)
  106. #error "Mcu.h and Mcu_IPW_Types.h have different vendor ids"
  107. #endif
  108. /* Check if Mcu.h file and Mcu_IPW_Types.h file are of the same Autosar version */
  109. #if ((MCU_AR_RELEASE_MAJOR_VERSION != MCU_IPW_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  110. (MCU_AR_RELEASE_MINOR_VERSION != MCU_IPW_TYPES_AR_RELEASE_MINOR_VERSION) || \
  111. (MCU_AR_RELEASE_REVISION_VERSION != MCU_IPW_TYPES_AR_RELEASE_REVISION_VERSION) \
  112. )
  113. #error "AutoSar Version Numbers of Mcu.h and Mcu_IPW_Types.h are different"
  114. #endif
  115. /* Check if Mcu.h file and Mcu_IPW_Types.h file are of the same Software version */
  116. #if ((MCU_SW_MAJOR_VERSION != MCU_IPW_TYPES_SW_MAJOR_VERSION) || \
  117. (MCU_SW_MINOR_VERSION != MCU_IPW_TYPES_SW_MINOR_VERSION) || \
  118. (MCU_SW_PATCH_VERSION != MCU_IPW_TYPES_SW_PATCH_VERSION) \
  119. )
  120. #error "Software Version Numbers of Mcu.h and Mcu_IPW_Types.h are different"
  121. #endif
  122. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  123. /* Check if Mcu.h file and Mcal.h header file are of the same Autosar version */
  124. #if ((MCU_AR_RELEASE_MAJOR_VERSION != MCAL_AR_RELEASE_MAJOR_VERSION) || \
  125. (MCU_AR_RELEASE_MINOR_VERSION != MCAL_AR_RELEASE_MINOR_VERSION))
  126. #error "AutoSar Version Numbers of Mcu.h and Mcal.h are different"
  127. #endif
  128. #endif
  129. /*==================================================================================================
  130. CONSTANTS
  131. ==================================================================================================*/
  132. /*==================================================================================================
  133. DEFINES AND MACROS
  134. ==================================================================================================*/
  135. /*==================================================================================================
  136. ENUMS
  137. ==================================================================================================*/
  138. /*==================================================================================================
  139. STRUCTURES AND OTHER TYPEDEFS
  140. ==================================================================================================*/
  141. /**
  142. * @brief Initialization data for the MCU driver.
  143. * @details A pointer to such a structure is provided to the MCU initialization routines for
  144. * configuration.
  145. * @implements Mcu_ConfigType_struct
  146. */
  147. typedef struct
  148. {
  149. #if (MCU_INIT_CLOCK == STD_ON)
  150. /**< @brief Clock source failure notification enable configuration. */
  151. Mcu_ClockNotificationType Mcu_ClkSrcFailureNotification;
  152. #endif
  153. #if (MCU_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)
  154. /**< @brief DEM error reporting configuration. */
  155. const Mcu_DemConfigType * Mcu_pDemConfig;
  156. #endif
  157. /**< @brief Total number of RAM sections. */
  158. Mcu_RamSectionType Mcu_NoRamConfigs;
  159. /**< @brief Total number of MCU modes. */
  160. Mcu_ModeType Mcu_NoModeConfigs;
  161. #if (MCU_INIT_CLOCK == STD_ON)
  162. /**< @brief Total number of MCU clock configurations. */
  163. Mcu_ClockType Mcu_NoClkConfigs;
  164. #endif /* (MCU_INIT_CLOCK == STD_ON) */
  165. #ifndef MCU_MAX_NORAMCONFIGS
  166. /**< @brief RAM data configuration. */
  167. const Mcu_RamConfigType (*Mcu_apRamConfig)[MCU_MAX_RAMCONFIGS];
  168. #endif
  169. /**< @brief Power Modes data configuration. */
  170. const Mcu_ModeConfigType (*Mcu_apModeConfig)[MCU_MAX_MODECONFIGS];
  171. #if (MCU_INIT_CLOCK == STD_ON)
  172. /**< @brief Clock data configuration. */
  173. const Mcu_ClockConfigType (*Mcu_apClockConfig)[MCU_MAX_CLKCONFIGS];
  174. #endif /* (MCU_INIT_CLOCK == STD_ON) */
  175. /**< @brief IPs data generic configuration. */
  176. const Mcu_HwIPsConfigType * Mcu_pHwIPsConfig;
  177. } Mcu_ConfigType;
  178. /*==================================================================================================
  179. GLOBAL CONSTANTS
  180. ==================================================================================================*/
  181. #if (MCU_PRECOMPILE_SUPPORT == STD_ON)
  182. #define MCU_START_SEC_CONFIG_DATA_UNSPECIFIED
  183. #include "Mcu_MemMap.h"
  184. extern const Mcu_ConfigType Mcu_PreCompileConfig;
  185. #define MCU_STOP_SEC_CONFIG_DATA_UNSPECIFIED
  186. #include "Mcu_MemMap.h"
  187. #endif /* #if (MCU_PRECOMPILE_SUPPORT == STD_ON) */
  188. /*==================================================================================================
  189. GLOBAL VARIABLE DECLARATIONS
  190. ==================================================================================================*/
  191. #define MCU_START_SEC_CONFIG_DATA_UNSPECIFIED
  192. #include "Mcu_MemMap.h"
  193. #if (MCU_PRECOMPILE_SUPPORT == STD_OFF)
  194. /**
  195. * @brief Export Post-Build configurations.
  196. */
  197. MCU_CONFIG_EXT
  198. #endif /* (MCU_PRECOMPILE_SUPPORT == STD_OFF) */
  199. #define MCU_STOP_SEC_CONFIG_DATA_UNSPECIFIED
  200. #include "Mcu_MemMap.h"
  201. #define MCU_START_SEC_VAR_CLEARED_UNSPECIFIED
  202. #include "Mcu_MemMap.h"
  203. #if (defined(MCU_CMU_ERROR_ISR_USED) && (MCU_CMU_ERROR_ISR_USED == STD_ON))
  204. /**
  205. * @brief Local copy of the pointer to the configuration data.
  206. */
  207. extern const Mcu_ConfigType * Mcu_pConfigPtr;
  208. #endif
  209. #define MCU_STOP_SEC_VAR_CLEARED_UNSPECIFIED
  210. #include "Mcu_MemMap.h"
  211. /*==================================================================================================
  212. FUNCTION PROTOTYPES
  213. ==================================================================================================*/
  214. #define MCU_START_SEC_CODE
  215. #include "Mcu_MemMap.h"
  216. /*!
  217. * @brief MCU driver initialization function.
  218. *
  219. * This routine initializes the MCU Driver.
  220. * The intention of this function is to make the configuration setting for power
  221. * down, clock and Ram sections visible within the MCU Driver.
  222. *
  223. * @param[in] pConfigPtr Pointer to configuration structure.
  224. * @return void
  225. */
  226. void Mcu_Init( const Mcu_ConfigType * pConfigPtr);
  227. /*!
  228. * @brief MCU driver initialization of Ram sections.
  229. *
  230. * Function initializes the ram section selected by RamSection parameter.
  231. * The section base address, size and value to be written are provided from
  232. * the configuration structure.
  233. * The function will write the value specified in the configuration structure
  234. * indexed by RamSection.
  235. * After the write it will read back the RAM to verify that the requested value was
  236. * written.
  237. *
  238. * @param[in] RamSection Index of ram section from configuration structure to be initialized.
  239. * @return Command has or has not been accepted.
  240. * @retval E_OK Valid parameter, the driver state allowed execution and the RAM
  241. * check was successful
  242. * @retval E_NOT_OK Invalid parameter, the driver state did not allowed execution or
  243. * the RAM check was not successful
  244. */
  245. Std_ReturnType Mcu_InitRamSection(Mcu_RamSectionType RamSection);
  246. #if (MCU_INIT_CLOCK == STD_ON)
  247. /*!
  248. * @brief MCU driver clock initialization function.
  249. *
  250. * This function intializes the PLL and MCU specific clock options.
  251. * The clock setting is provided from the configuration structure.
  252. *
  253. * @param[in] ClockSetting Clock setting ID from config structure to be used.
  254. *
  255. * @return Command has or has not been accepted.
  256. * @retval E_OK The driver state allowed the execution of the function and the
  257. * provided parameter was in range
  258. * @retval E_NOT_OK The driver state did not allowed execution or the parameter was
  259. * invalid
  260. */
  261. Std_ReturnType Mcu_InitClock(Mcu_ClockType ClockSetting);
  262. #endif /* (MCU_INIT_CLOCK == STD_ON) */
  263. /*!
  264. * @brief This function sets the MCU power mode.
  265. *
  266. * This function activates MCU power mode from config structure selected by McuMode parameter.
  267. * If the driver state is invalid or McuMode is not in range the function will skip
  268. * changing the mcu mode.
  269. *
  270. * @param[in] McuMode MCU mode setting ID from config structure to be set.
  271. *
  272. * @return void
  273. */
  274. void Mcu_SetMode(Mcu_ModeType McuMode);
  275. #if (MCU_INIT_CLOCK == STD_ON)
  276. #if (MCU_NO_PLL == STD_OFF)
  277. /*!
  278. * @brief This function activates the PLL clock to the MCU clock distribution.
  279. *
  280. * Function completes the PLL configuration and then activates the PLL clock to MCU.
  281. * If the MCU_NO_PLL is TRUE the Mcu_DistributePllClock has to be disabled.
  282. * The function will not distribute the PLL clock if the driver state does not allow it,
  283. * or the PLL is not stable.
  284. *
  285. * @return Std_ReturnType
  286. * @retval E_OK Command has been accepted.
  287. * @retval E_NOT_OK Command has not been accepted.
  288. */
  289. Std_ReturnType Mcu_DistributePllClock(void);
  290. #endif /* (MCU_NO_PLL == STD_OFF) */
  291. #endif /* (MCU_INIT_CLOCK == STD_ON) */
  292. /*!
  293. * @brief This function returns the lock status of the PLL.
  294. *
  295. * The user takes care that the PLL is locked by executing Mcu_GetPllStatus.
  296. * If the MCU_NO_PLL is TRUE the MCU_GetPllStatus has to return MCU_PLL_STATUS_UNDEFINED.
  297. * It will also return MCU_PLL_STATUS_UNDEFINED if the driver state was invalid
  298. *
  299. * @return Mcu_PllStatusType Provides the lock status of the PLL.
  300. * @retval MCU_PLL_STATUS_UNDEFINED PLL Status is unknown.
  301. * @retval MCU_PLL_LOCKED PLL is locked.
  302. * @retval MCU_PLL_UNLOCKED PLL is unlocked.
  303. */
  304. Mcu_PllStatusType Mcu_GetPllStatus(void);
  305. /*!
  306. * @brief This function returns the Reset reason.
  307. *
  308. * This routine returns the Reset reason that is read from the hardware.
  309. *
  310. * @return Mcu_ResetType Reason of the Reset event.
  311. */
  312. Mcu_ResetType Mcu_GetResetReason(void);
  313. /*!
  314. * @brief This function returns the Raw Reset value.
  315. *
  316. * This routine returns the Raw Reset value that is read from the hardware.
  317. *
  318. * @return Mcu_RawResetType Description of the returned value.
  319. * @retval uint32 Code of the Raw reset value.
  320. */
  321. Mcu_RawResetType Mcu_GetResetRawValue(void);
  322. #if MCU_PERFORM_RESET_API == STD_ON
  323. /*!
  324. * @brief This function performs a microcontroller reset.
  325. *
  326. * This function performs a microcontroller reset by using the hardware feature of the microcontroller.
  327. * In case the function returns, the user must reset the platform using an alternate reset mechanism
  328. *
  329. * @return void
  330. */
  331. void Mcu_PerformReset(void);
  332. #endif /* (MCU_PERFORM_RESET_API == STD_ON) */
  333. #if (MCU_VERSION_INFO_API == STD_ON)
  334. /*!
  335. * @brief This function returns the Version Information for the MCU module.
  336. *
  337. * This function returns the vendor id, module id, major, minor and patch version.
  338. *
  339. * @param[in,out] pVersionInfo A pointer to a variable to store version info.
  340. *
  341. * @return void
  342. */
  343. void Mcu_GetVersionInfo(Std_VersionInfoType * pVersionInfo);
  344. #endif /* (MCU_VERSION_INFO_API == STD_ON) */
  345. #if (MCU_GET_RAM_STATE_API == STD_ON)
  346. /*!
  347. * @brief This function returns the actual state of the RAM.
  348. *
  349. * This function returns if the Ram Status is valid after a reset.
  350. * The report is get from STCU as a result of MBIST (Memory Built-In Self Tests).
  351. *
  352. * @return Mcu_RamStateType Status of the Ram Content.
  353. *
  354. * @retval MCU_RAMSTATE_INVALID Ram state is not valid or unknown (default),
  355. * or the driver state does not allow this call.
  356. * @retval MCU_RAMSTATE_VALID Ram state is valid.
  357. */
  358. Mcu_RamStateType Mcu_GetRamState(void);
  359. #endif /* (MCU_GET_RAM_STATE_API == STD_ON) */
  360. #if (MCU_GET_PERIPH_STATE_API == STD_ON)
  361. /*!
  362. * @brief This function returns the peripheral clock state.
  363. *
  364. * This function returns one peripheral is frozen or active from MC_ME hw IP.
  365. *
  366. * @param[in] McuPeriphId Peripheral ID based ME_PSx registers.
  367. *
  368. * @return Std_ReturnType Status of the peripheral clock.
  369. * @retval E_OK Peripheral is active (clocked).
  370. * @retval E_NOT_OK Peripheral is not active (not clocked) or the driver state did not
  371. * allow the call.
  372. */
  373. Std_ReturnType Mcu_GetPeripheralState(Mcu_PeripheralIdType McuPeriphId);
  374. #endif /* (MCU_GET_PERIPH_STATE_API == STD_ON) */
  375. #if (MCU_GET_SYSTEM_STATE_API == STD_ON)
  376. /*!
  377. * @brief This function returns the System Status and Configuration Module information.
  378. *
  379. * This function returns information about execution mode, security, vle, jtag id.
  380. *
  381. * @return Mcu_SSCM_SystemStateType Status read from SSCM module - STATUS and MEMCONFIG registers.
  382. * @retval uint32 Platform register specific.
  383. */
  384. Mcu_SSCM_SystemStateType Mcu_GetSystemState(void);
  385. #endif /* (MCU_GET_SYSTEM_STATE_API == STD_ON) */
  386. #if (MCU_POWERMODE_STATE_API == STD_ON)
  387. /*!
  388. * @brief This function returns the System Status (power mode, clock settings) from MC_ME
  389. * hw IP.
  390. * The return value is the content register read from hardware (ME_GS).
  391. * The return value shall evidentiate the current running mode, clock settings and activation, etc.
  392. *
  393. * @return Mcu_PowerModeStateType Get the state of the power mode.
  394. * @retval uint32 Content of ME_GS register.
  395. */
  396. Mcu_PowerModeStateType Mcu_GetPowerModeState(void);
  397. #endif /* (MCU_POWERMODE_STATE_API == STD_ON) */
  398. #if (MCU_GET_POWER_DOMAIN_API == STD_ON)
  399. /*!
  400. * @brief This function returns the power status of all available power domains.
  401. *
  402. * This function returns if power domain is operable or inoperable form MC_PCU hw
  403. * IP.
  404. *
  405. * @return Std_ReturnType Get the state of Power Control Unit
  406. * @retval E_OK Power domain is operable.
  407. * @retval E_NOT_OK Power domain is inoperable or the driver state did not alloed the
  408. * functionc all.
  409. */
  410. Std_ReturnType Mcu_GetPowerDomainState(void);
  411. #endif /* (MCU_GET_POWER_DOMAIN_API == STD_ON) */
  412. #ifdef MCU_GET_MEM_CONFIG_API
  413. #if (MCU_GET_MEM_CONFIG_API == STD_ON)
  414. /*!
  415. * @brief This function returns the System Memory and ID register from SSCM.
  416. *
  417. * This function returns the value of the SSCM_MEMCONFIG register.
  418. *
  419. * @return Value read from SSCM_MEMCONFIG register.
  420. * @retval Mcu_SSCM_MemConfigType Platform register specific.
  421. */
  422. Mcu_SSCM_MemConfigType Mcu_SscmGetMemConfig(void);
  423. #endif /* (MCU_GET_MEM_CONFIG_API == STD_ON) */
  424. #endif /* MCU_GET_MEM_CONFIG_API */
  425. #ifdef MCU_SSCM_GET_STATUS_API
  426. #if (MCU_SSCM_GET_STATUS_API == STD_ON)
  427. /*!
  428. * @brief This function returns the value of the SSCM_STATUS register..
  429. * Return information about execution mode, security, vle.
  430. *
  431. * @return Value read from SSCM_STATUS register.
  432. * @retval Mcu_SSCM_StatusType Platform register specific.
  433. *
  434. */
  435. Mcu_SSCM_StatusType Mcu_SscmGetStatus(void);
  436. #endif /* (MCU_SSCM_GET_STATUS_API == STD_ON) */
  437. #endif /* MCU_SSCM_GET_STATUS_API */
  438. #ifdef MCU_SSCM_GET_UOPT_API
  439. #if (MCU_SSCM_GET_UOPT_API == STD_ON)
  440. /*!
  441. * @brief This function returns the value of the SSCM_UOPT register.
  442. *
  443. * Return information about User Option Bits, HSM Boot Configuration.
  444. *
  445. * @return Value read from SSCM_UOPT register.
  446. * @retval Mcu_SSCM_UoptType Platform register specific.
  447. */
  448. Mcu_SSCM_UoptType Mcu_SscmGetUopt(void);
  449. #endif /* (MCU_SSCM_GET_UOPT_API == STD_ON) */
  450. #endif /* MCU_SSCM_GET_UOPT_API */
  451. #ifdef MCU_GET_MIDR_API
  452. #if (MCU_GET_MIDR_API == STD_ON)
  453. /*!
  454. * @brief This function returns the value of the MIDR registers.
  455. *
  456. * This function returns the platform dependent Mcu_MidrReturnType structure witch
  457. * contains the MIDRn registers.
  458. *
  459. * @param[in,out] pMidr A pointer to a variable to store the Mcu_MidrReturnType structure.
  460. *
  461. * @return void
  462. */
  463. void Mcu_GetMidrStructure(Mcu_MidrReturnType pMidr[MCU_SIUL2_TOTAL_UNITS]);
  464. #endif /* (MCU_GET_MIDR_API == STD_ON) */
  465. #endif /* MCU_GET_MIDR_API */
  466. #ifdef MCU_EMIOS_CONFIGURE_GPREN_API
  467. #if (MCU_EMIOS_CONFIGURE_GPREN_API == STD_ON)
  468. /*!
  469. * @brief eMios Global Prescaler Enable.
  470. *
  471. * This function enables or disables the GPREN bit of the EMIOSMCR register of an
  472. * addressed eMIOS instance.
  473. *
  474. * @pre Function requires an execution of Mcu_Init() before it can be used,
  475. * otherwise it reports error to DET.
  476. *
  477. * @param[in] u8Module MCU_EMIOS_MODULE_0 --> Select eMios 0
  478. * MCU_EMIOS_MODULE_1 --> Select eMios 1
  479. * MCU_EMIOS_MODULE_2 --> Select eMios 2
  480. *
  481. * @param[in] u8Value MCU_EMIOS_GPREN_BIT_ENABLE --> Global Prescaler Enabled
  482. * MCU_EMIOS_GPREN_BIT_DISABLE --> Global Prescaler Disabled
  483. *
  484. * @return void
  485. */
  486. void Mcu_EmiosConfigureGpren(uint8 u8Module, uint8 u8Value);
  487. #endif /* (MCU_EMIOS_CONFIGURE_GPREN_API == STD_ON) */
  488. #endif /* MCU_EMIOS_CONFIGURE_GPREN_API */
  489. #ifdef MCU_DISABLE_CMU_API
  490. #if (MCU_DISABLE_CMU_API == STD_ON)
  491. /*!
  492. * @brief Disable clock monitoring unit.
  493. *
  494. * This function disables the selected clock monitoring unit.
  495. *
  496. * @pre Function requires an execution of Mcu_Init() before it can be used.
  497. *
  498. * @param[in] clockName Name of the monitor clock for which CMU must be disabled.
  499. *
  500. * @return void
  501. */
  502. void Mcu_DisableCmu(Clock_Ip_NameType clockName);
  503. #endif
  504. #endif
  505. #ifdef MCU_GET_CLOCK_FREQUENCY_API
  506. #if (MCU_GET_CLOCK_FREQUENCY_API == STD_ON)
  507. /*!
  508. * @brief Return the frequency of a given clock.
  509. *
  510. * This function returns the frequency of a given clock which is request by user.
  511. *
  512. * @pre Function requires an execution of Mcu_Init() before it can be used,
  513. *
  514. * @param[in] clockName Name of the monitor clock for which CMU must be disabled.
  515. *
  516. * @return uint32
  517. */
  518. uint32 Mcu_GetClockFrequency(Clock_Ip_NameType clockName);
  519. #endif /* (MCU_GET_CLOCK_FREQUENCY_API == STD_ON) */
  520. #endif /* MCU_GET_CLOCK_FREQUENCY_API */
  521. #ifdef MCU_SLEEPONEXIT_SUPPORT
  522. #if (MCU_SLEEPONEXIT_SUPPORT == STD_ON)
  523. /*!
  524. * @brief This function disable/enable SleepOnExit.
  525. *
  526. * Disable/enable Sleep on exit when returning from Handler mode to Thread mode.
  527. *
  528. * @param[in] Mcu_SleepOnExitType The value will be configured to SLEEPONEXIT bits.
  529. * MCU_SLEEP_ON_EXIT_DISABLED - Disable SLEEPONEXIT bit.
  530. * MCU_SLEEP_ON_EXIT_ENABLED - Enable SLEEPONEXIT bit.
  531. *
  532. * @return void
  533. */
  534. void Mcu_SleepOnExit(Mcu_SleepOnExitType SleepOnExit);
  535. #endif
  536. #endif
  537. #ifdef MCU_SRAM_RETEN_CONFIG_API
  538. #if (MCU_SRAM_RETEN_CONFIG_API == STD_ON)
  539. void Mcu_SRAMRetentionConfig(Mcu_SRAMRetenConfigType eSRAMRetenConfig);
  540. #endif
  541. #endif
  542. #define MCU_STOP_SEC_CODE
  543. #include "Mcu_MemMap.h"
  544. #ifdef __cplusplus
  545. }
  546. #endif
  547. #endif /* MCU_H */
  548. /** @} */