Mcu_Cfg.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  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_Cfg.h
  26. * @implements Mcu_Cfg.h_Artifact
  27. * @version 1.0.0
  28. *
  29. * @brief AUTOSAR Mcu - Configuration file for the driver.
  30. * @details Precompile parameters and extern configuration.
  31. *
  32. * @addtogroup MCU
  33. * @{
  34. */
  35. #ifndef MCU_CFG_H
  36. #define MCU_CFG_H
  37. #ifdef __cplusplus
  38. extern "C"{
  39. #endif
  40. /*==================================================================================================
  41. INCLUDE FILES
  42. 1) system and project includes
  43. 2) needed interfaces from external units
  44. 3) internal and external interfaces from this unit
  45. ==================================================================================================*/
  46. #include "Mcal.h"
  47. #include "Clock_Ip_Cfg.h"
  48. #include "Power_Ip_Cfg.h"
  49. #include "Ram_Ip_Cfg.h"
  50. #include "Mcu_VS_0_PBcfg.h"
  51. /*==================================================================================================
  52. SOURCE FILE VERSION INFORMATION
  53. ==================================================================================================*/
  54. #define MCU_CFG_VENDOR_ID 43
  55. #define MCU_CFG_AR_RELEASE_MAJOR_VERSION 4
  56. #define MCU_CFG_AR_RELEASE_MINOR_VERSION 4
  57. #define MCU_CFG_AR_RELEASE_REVISION_VERSION 0
  58. #define MCU_CFG_SW_MAJOR_VERSION 1
  59. #define MCU_CFG_SW_MINOR_VERSION 0
  60. #define MCU_CFG_SW_PATCH_VERSION 0
  61. /*==================================================================================================
  62. * FILE VERSION CHECKS
  63. ==================================================================================================*/
  64. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  65. /* Check if header file and Mcal header file are of the same Autosar version */
  66. #if ((MCU_CFG_AR_RELEASE_MAJOR_VERSION != MCAL_AR_RELEASE_MAJOR_VERSION) || \
  67. (MCU_CFG_AR_RELEASE_MINOR_VERSION != MCAL_AR_RELEASE_MINOR_VERSION))
  68. #error "AutoSar Version Numbers of Mcu_Cfg.h and Mcal.h are different"
  69. #endif
  70. #endif
  71. /* Check if header file and Clock_Ip_Cfg.h file are of the same vendor */
  72. #if (MCU_CFG_VENDOR_ID != CLOCK_IP_CFG_VENDOR_ID)
  73. #error "Mcu_Cfg.h and Clock_Ip_Cfg.h have different vendor ids"
  74. #endif
  75. /* Check if header file and Clock_Ip_Cfg.h file are of the same Autosar version */
  76. #if ((MCU_CFG_AR_RELEASE_MAJOR_VERSION != CLOCK_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \
  77. (MCU_CFG_AR_RELEASE_MINOR_VERSION != CLOCK_IP_CFG_AR_RELEASE_MINOR_VERSION) || \
  78. (MCU_CFG_AR_RELEASE_REVISION_VERSION != CLOCK_IP_CFG_AR_RELEASE_REVISION_VERSION) \
  79. )
  80. #error "AutoSar Version Numbers of Mcu_Cfg.h and Clock_Ip_Cfg.h are different"
  81. #endif
  82. /* Check if header file and Clock_Ip_Cfg.h file are of the same Software version */
  83. #if ((MCU_CFG_SW_MAJOR_VERSION != CLOCK_IP_CFG_SW_MAJOR_VERSION) || \
  84. (MCU_CFG_SW_MINOR_VERSION != CLOCK_IP_CFG_SW_MINOR_VERSION) || \
  85. (MCU_CFG_SW_PATCH_VERSION != CLOCK_IP_CFG_SW_PATCH_VERSION) \
  86. )
  87. #error "Software Version Numbers of Mcu_Cfg.h and Clock_Ip_Cfg.h are different"
  88. #endif
  89. /* Check if header file and Power_Ip_Cfg.h file are of the same vendor */
  90. #if (MCU_CFG_VENDOR_ID != POWER_IP_CFG_VENDOR_ID)
  91. #error "Mcu_Cfg.h and Power_Ip_Cfg.h have different vendor ids"
  92. #endif
  93. /* Check if header file and Power_Ip_Cfg.h file are of the same Autosar version */
  94. #if ((MCU_CFG_AR_RELEASE_MAJOR_VERSION != POWER_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \
  95. (MCU_CFG_AR_RELEASE_MINOR_VERSION != POWER_IP_CFG_AR_RELEASE_MINOR_VERSION) || \
  96. (MCU_CFG_AR_RELEASE_REVISION_VERSION != POWER_IP_CFG_AR_RELEASE_REVISION_VERSION) \
  97. )
  98. #error "AutoSar Version Numbers of Mcu_Cfg.h and Power_Ip_Cfg.h are different"
  99. #endif
  100. /* Check if header file and Power_Ip_Cfg.h file are of the same Software version */
  101. #if ((MCU_CFG_SW_MAJOR_VERSION != POWER_IP_CFG_SW_MAJOR_VERSION) || \
  102. (MCU_CFG_SW_MINOR_VERSION != POWER_IP_CFG_SW_MINOR_VERSION) || \
  103. (MCU_CFG_SW_PATCH_VERSION != POWER_IP_CFG_SW_PATCH_VERSION) \
  104. )
  105. #error "Software Version Numbers of Mcu_Cfg.h and Power_Ip_Cfg.h are different"
  106. #endif
  107. /* Check if header file and Ram_Ip_Cfg.h file are of the same vendor */
  108. #if (MCU_CFG_VENDOR_ID != RAM_IP_CFG_VENDOR_ID)
  109. #error "Mcu_Cfg.h and Ram_Ip_Cfg.h have different vendor ids"
  110. #endif
  111. /* Check if header file and Ram_Ip_Cfg.h file are of the same Autosar version */
  112. #if ((MCU_CFG_AR_RELEASE_MAJOR_VERSION != RAM_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \
  113. (MCU_CFG_AR_RELEASE_MINOR_VERSION != RAM_IP_CFG_AR_RELEASE_MINOR_VERSION) || \
  114. (MCU_CFG_AR_RELEASE_REVISION_VERSION != RAM_IP_CFG_AR_RELEASE_REVISION_VERSION) \
  115. )
  116. #error "AutoSar Version Numbers of Mcu_Cfg.h and Ram_Ip_Cfg.h are different"
  117. #endif
  118. /* Check if header file and Ram_Ip_Cfg.h file are of the same Software version */
  119. #if ((MCU_CFG_SW_MAJOR_VERSION != RAM_IP_CFG_SW_MAJOR_VERSION) || \
  120. (MCU_CFG_SW_MINOR_VERSION != RAM_IP_CFG_SW_MINOR_VERSION) || \
  121. (MCU_CFG_SW_PATCH_VERSION != RAM_IP_CFG_SW_PATCH_VERSION) \
  122. )
  123. #error "Software Version Numbers of Mcu_Cfg.h and Ram_Ip_Cfg.h are different"
  124. #endif
  125. /* Check if header file and Mcu_VS_0_PBcfg.h file are of the same vendor */
  126. #if (MCU_CFG_VENDOR_ID != MCU_VS_0_PBCFG_VENDOR_ID)
  127. #error "Mcu_Cfg.h and Mcu_VS_0_PBcfg.h have different vendor ids"
  128. #endif
  129. /* Check if header file and Mcu_VS_0_PBcfg.h file are of the same Autosar version */
  130. #if ((MCU_CFG_AR_RELEASE_MAJOR_VERSION != MCU_VS_0_PBCFG_AR_RELEASE_MAJOR_VERSION) || \
  131. (MCU_CFG_AR_RELEASE_MINOR_VERSION != MCU_VS_0_PBCFG_AR_RELEASE_MINOR_VERSION) || \
  132. (MCU_CFG_AR_RELEASE_REVISION_VERSION != MCU_VS_0_PBCFG_AR_RELEASE_REVISION_VERSION) \
  133. )
  134. #error "AutoSar Version Numbers of Mcu_Cfg.h and Mcu_VS_0_PBcfg.h are different"
  135. #endif
  136. /* Check if header file and Mcu_VS_0_PBcfg.h file are of the same Software version */
  137. #if ((MCU_CFG_SW_MAJOR_VERSION != MCU_VS_0_PBCFG_SW_MAJOR_VERSION) || \
  138. (MCU_CFG_SW_MINOR_VERSION != MCU_VS_0_PBCFG_SW_MINOR_VERSION) || \
  139. (MCU_CFG_SW_PATCH_VERSION != MCU_VS_0_PBCFG_SW_PATCH_VERSION) \
  140. )
  141. #error "Software Version Numbers of Mcu_Cfg.h and Mcu_VS_0_PBcfg.h are different"
  142. #endif
  143. /*==================================================================================================
  144. DEFINES AND MACROS
  145. ==================================================================================================*/
  146. #define MCU_CONFIG_EXT \
  147. MCU_CONFIG_VS_0_PB \
  148. /**
  149. * @brief Specifies the InstanceId of this module instance.
  150. */
  151. #define MCU_INSTANCE_ID ((uint8)0x0U)
  152. /**
  153. @{
  154. * @brief Service Ids for MCU APIs.
  155. */
  156. #define MCU_INIT_ID ((uint8)0x00U)
  157. #define MCU_INITRAMSECTION_ID ((uint8)0x01U)
  158. #define MCU_INITCLOCK_ID ((uint8)0x02U)
  159. #define MCU_DISTRIBUTEPLLCLOCK_ID ((uint8)0x03U)
  160. #define MCU_GETPLLSTATUS_ID ((uint8)0x04U)
  161. #define MCU_GETRESETREASON_ID ((uint8)0x05U)
  162. #define MCU_GETRESETRAWVALUE_ID ((uint8)0x06U)
  163. #define MCU_PERFORMRESET_ID ((uint8)0x07U)
  164. #define MCU_SETMODE_ID ((uint8)0x08U)
  165. #define MCU_GETVERSIONINFO_ID ((uint8)0x09U)
  166. #define MCU_GETRAMSTATE_ID ((uint8)0x0AU)
  167. /**@}*/
  168. /**
  169. @{
  170. * @brief Service Ids for NonASR MCU APIs.
  171. */
  172. #define MCU_GETPOWERDOMAIN_ID ((uint8)0x0BU)
  173. #define MCU_GETPERIPHERALSTATE_ID ((uint8)0x0CU)
  174. #define MCU_GETSYSTEMSTATE_ID ((uint8)0x0DU)
  175. #define MCU_GETPOWERMODESTATE_ID ((uint8)0x0EU)
  176. #define MCU_GETMEMCONFIG_ID ((uint8)0x13U)
  177. #define MCU_GETMIDRSTRUCTURE_ID ((uint8)0x14U)
  178. #define MCU_SSCMGETSTATUS_ID ((uint8)0x15U)
  179. #define MCU_SSCMGETUOPT_ID ((uint8)0x16U)
  180. #define MCU_DISABLECMU_ID ((uint8)0x17U)
  181. #define MCU_EMIOSCONFIGUREGPREN_ID ((uint8)0x18U)
  182. #define MCU_GETCLOCKFREQUENCY_ID ((uint8)0x19U)
  183. #define MCU_SLEEPONEXIT_ID ((uint8)0x1AU)
  184. #define MCU_SRAMRETENCONFIG_ID ((uint8)0x1BU)
  185. /**@}*/
  186. /**
  187. * @brief Pre-processor switch for enabling the default error detection and reporting to the DET.
  188. * The detection of default errors is configurable (ON / OFF) at pre-compile time.
  189. */
  190. #define MCU_DEV_ERROR_DETECT (STD_OFF)
  191. /**
  192. * @brief If this parameter is set to TRUE, the Power Management Controller (PMC) initialization has to be disabled from the MCU driver.
  193. */
  194. #define MCU_DISABLE_PMC_INIT (STD_OFF)
  195. /**
  196. * @brief If this parameter is set to TRUE, the Reset Control Module (RMC) initialization has to be disabled from the MCU driver.
  197. */
  198. #define MCU_DISABLE_RCM_INIT (STD_OFF)
  199. /**
  200. * @brief If this parameter is set to TRUE, the System Mode Controller (SMC) initialization has to be disabled from the MCU driver.
  201. */
  202. #define MCU_DISABLE_SMC_INIT (STD_OFF)
  203. /**
  204. * @brief Pre-processor switch to enable/disable the API to read out the modules version information.
  205. */
  206. #define MCU_VERSION_INFO_API (STD_OFF)
  207. /**
  208. * @brief Pre-processor switch to enable/disable the API Mcu_GetRamState.
  209. */
  210. #define MCU_GET_RAM_STATE_API (STD_OFF)
  211. /**
  212. * @brief If this parameter is set to FALSE, the clock initialization has to be disabled from the MCU driver.
  213. */
  214. #define MCU_INIT_CLOCK (STD_ON)
  215. /**
  216. * @brief This parameter shall be set True, if the H/W does not have a PLL or the PLL circuitry is enabled after the power on without S/W intervention.
  217. */
  218. #define MCU_NO_PLL (STD_OFF)
  219. /**
  220. * @brief define for interrupt CMU, PMC, SCG peripheral
  221. */
  222. #define MCU_CMU_PMC_SCG_INTERRUPT (STD_OFF)
  223. #if (MCU_PERFORM_RESET_API == STD_ON)
  224. /**
  225. * @brief The user callout reset is/isn't available (STD_ON/STD_OFF) - called by MCU right before Mcu_PerformReset().
  226. */
  227. #define MCU_RESET_CALLOUT_USED (STD_OFF)
  228. #endif
  229. /**
  230. * @brief ISR Mcu_CmuClockFail_ISR is/isn't available
  231. */
  232. #define MCU_CMU_ERROR_ISR_USED (STD_OFF)
  233. /**
  234. * @brief Enable the usage of Non-Autosar API Mcu_GetPeripheral_State() for getting infos about peripheral state from MC_ME module.
  235. */
  236. #define MCU_GET_PERIPH_STATE_API (STD_OFF)
  237. /**
  238. * @brief Enable the usage of Non-Autosar API Mcu_GetPowerMode_State() for getting infos system platform configuration.
  239. */
  240. #define MCU_POWERMODE_STATE_API (STD_OFF)
  241. /**
  242. * @brief Enable the usage of Non-Autosar API Mcu_GetPowerDomain_Status. Get PMU state: operable or not.
  243. */
  244. #define MCU_GET_POWER_DOMAIN_API (STD_OFF)
  245. /**
  246. * @brief Enable the usage of Non-Autosar API Mcu_GetSystem_State() for getting system platform configuration information. Get (SSCM_STATUS | SSCM_MEMCONFIG).
  247. */
  248. #define MCU_GET_SYSTEM_STATE_API (STD_OFF)
  249. /**
  250. * @brief Enable the usage of Non-Autosar API Mcu_SscmGetMemConfig(). Get SSCM_MEMCONFIG.
  251. */
  252. #define MCU_GET_MEM_CONFIG_API (STD_OFF)
  253. /**
  254. * @brief Enable the usage of Non-Autosar API Mcu_SscmGetStatus(). Get SSCM_STATUS.
  255. */
  256. #define MCU_SSCM_GET_STATUS_API (STD_OFF)
  257. /**
  258. * @brief Enable the usage of Non-Autosar API Mcu_SscmGetUopt(). Get SSCM_UOPT.
  259. */
  260. #define MCU_SSCM_GET_UOPT_API (STD_OFF)
  261. /**
  262. * @brief Enable the usage of Non-Autosar API Mcu_GetMidrStructure(). Returns .
  263. */
  264. #define MCU_GET_MIDR_API (STD_OFF)
  265. /**
  266. * @brief Enable the usage of Non-Autosar API Mcu_EmiosConfigureGpren().
  267. */
  268. #define MCU_EMIOS_CONFIGURE_GPREN_API (STD_OFF)
  269. /**
  270. * @brief Enable the usage of Non-Autosar API Mcu_Disable_CMU().
  271. */
  272. #define MCU_DISABLE_CMU_API (STD_OFF)
  273. /**
  274. * @brief Enable the usage of Non-Autosar API Mcu_GetClockFrequency().
  275. */
  276. #define MCU_GET_CLOCK_FREQUENCY_API (STD_ON)
  277. /**
  278. * @brief Enable/Disable the API for reporting the Dem Error.
  279. */
  280. #define MCU_DISABLE_DEM_REPORT_ERROR_STATUS (STD_ON)
  281. /**
  282. * @brief Enable the usage of Non-Autosar API Mcu_SRAMRetentionConfig().
  283. */
  284. #define MCU_SRAM_RETEN_CONFIG_API (STD_OFF)
  285. /**
  286. * @brief Enable/Disable the Ram Notification.
  287. */
  288. #define MCU_DISABLE_RAM_CONFIG (STD_ON)
  289. /**
  290. * @brief Enable/Disable the Flash Notification.
  291. */
  292. #define MCU_DISABLE_FLASH_CONFIG (STD_ON)
  293. /**
  294. * @brief ISR Mcu_VoltageError_ISR is/isn't available (STD_ON/STD_OFF)
  295. */
  296. #if (MCU_CMU_PMC_SCG_INTERRUPT == STD_ON)
  297. #define MCU_VOLTAGE_ERROR_ISR_USED (STD_OFF)
  298. #endif
  299. /**
  300. * @brief Maximum number of MCU Clock configurations.
  301. */
  302. #define MCU_MAX_CLKCONFIGS ((uint32)1U)
  303. /**
  304. * @brief Maximum number of MCU Mode configurations.
  305. */
  306. #define MCU_MAX_MODECONFIGS ((uint32)1U)
  307. /**
  308. * @brief Maximum number of MCU Ram configurations.
  309. */
  310. #define MCU_MAX_RAMCONFIGS ((uint32)0U)
  311. #define MCU_MAX_NORAMCONFIGS
  312. /**
  313. * @brief Pre-compile Support.
  314. */
  315. #define MCU_PRECOMPILE_SUPPORT (STD_OFF)
  316. #ifdef MCU_GET_MIDR_API
  317. #if (MCU_GET_MIDR_API == STD_ON)
  318. /**
  319. * @brief Number of total available SIUL2 (SIUL2 + SIUL2_AE) units.
  320. */
  321. #define MCU_SIUL2_TOTAL_UNITS ((uint8)0U)
  322. #endif
  323. #endif
  324. /**
  325. * @brief Number of Clock Muxes per CGM module
  326. */
  327. /**
  328. * @brief Index of CGMs module
  329. */
  330. #ifdef MCU_ERROR_ISR_NOTIFICATION
  331. /* This is used to clear CMU flags from the RGM interrupt */
  332. #define MCU_CMU_CLEAR_CLOCK_IRQ_FLAG (MCU_CMU_ERROR_ISR_USED)
  333. #endif
  334. #if !(defined (CLOCK_IP_S32K1))
  335. /**
  336. * @brief Support for User mode.
  337. * If this parameter has been configured to 'TRUE' the Mcu driver can be executed from both supervisor and user mode.
  338. */
  339. #define MCU_ENABLE_USER_MODE_SUPPORT (STD_OFF)
  340. /** Check the driver user mode is enabled only when the MCAL_ENABLE_USER_MODE_SUPPORT is enabled */
  341. #ifndef MCAL_ENABLE_USER_MODE_SUPPORT
  342. #if (MCU_ENABLE_USER_MODE_SUPPORT == STD_ON)
  343. #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running Mcu in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined.
  344. #endif /* (MCU_ENABLE_USER_MODE_SUPPORT == STD_ON) */
  345. #endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT */
  346. #endif /* CLOCK_IP_S32K1 */
  347. /**
  348. * @brief The function Mcu_GetResetRawValue shall return an implementation specific value which does
  349. * not correspond to a valid value of the reset status register and is not equal to 0 if this
  350. * function is called prior to calling of the function Mcu_Init, and if supported by the
  351. * hardware.
  352. *
  353. */
  354. #define MCU_RAW_RESET_DEFAULT ((uint32)0xFFFFFFFFUL)
  355. /** @brief This is the corresponding bit of Stop Acknowledge Error reset in the returned value of Mcu_GetResetRawReason */
  356. #define MCU_RAW_RESET_SACKERR ((uint32)0x00002000U)
  357. /** @brief This is the corresponding bit of MDM-AP System Reset Request in the returned value of Mcu_GetResetRawReason */
  358. #define MCU_RAW_RESET_MDM_AP ((uint32)0x00000800U)
  359. /** @brief This is the corresponding bit of Software reset in the returned value of Mcu_GetResetRawReason */
  360. #define MCU_RAW_RESET_SW ((uint32)0x00000400U)
  361. /** @brief This is the corresponding bit of Stop Core Lockup reset in the returned value of Mcu_GetResetRawReason */
  362. #define MCU_RAW_RESET_LOCKUP ((uint32)0x00000200U)
  363. /** @brief This is the corresponding bit of JTAG generated reset in the returned value of Mcu_GetResetRawReason */
  364. #define MCU_RAW_RESET_JTAG ((uint32)0x00000100U)
  365. /** @brief This is the corresponding bit of Power-on reset in the returned value of Mcu_GetResetRawReason */
  366. #define MCU_RAW_RESET_POR ((uint32)0x00000080U)
  367. /** @brief This is the corresponding bit of external pin reset in the returned value of Mcu_GetResetRawReason */
  368. #define MCU_RAW_RESET_PIN ((uint32)0x00000040U)
  369. /** @brief This is the corresponding bit of watchdog reset in the returned value of Mcu_GetResetRawReason */
  370. #define MCU_RAW_RESET_WDOG ((uint32)0x00000020U)
  371. /** @brief This is the corresponding bit of CMU Loss-of-Lock reset in the returned value of Mcu_GetResetRawReason */
  372. #define MCU_RAW_RESET_CMU_LOC ((uint32)0x00000010U)
  373. /** @brief This is the corresponding bit of Loss-of-Lock reset in the returned value of Mcu_GetResetRawReason */
  374. #define MCU_RAW_RESET_LOL ((uint32)0x00000008U)
  375. /** @brief This is the corresponding bit of Loss-of-Clock reset in the returned value of Mcu_GetResetRawReason */
  376. #define MCU_RAW_RESET_LOC ((uint32)0x00000004U)
  377. /** @brief This is the corresponding bit of Low-Voltage Detect reset or High-Voltage Detect reset in the returned value of Mcu_GetResetRawReason */
  378. #define MCU_RAW_RESET_LVD ((uint32)0x00000002U)
  379. /**
  380. * @brief This define controls the availability of function Mcu_SleepOnExit
  381. */
  382. #define MCU_SLEEPONEXIT_SUPPORT (STD_ON)
  383. /*==================================================================================================
  384. DEFINES AND MACROS
  385. ==================================================================================================*/
  386. #if (MCU_DEV_ERROR_DETECT == STD_ON)
  387. /**
  388. @{
  389. * @brief Default error values are of type uint8.
  390. * The following errors and exceptions shall be detectable by the MCU module depending on its
  391. * build version (Default/production mode).
  392. *
  393. */
  394. #define MCU_E_PARAM_CONFIG ((uint8)0x0AU)
  395. #if (MCU_INIT_CLOCK == STD_ON)
  396. #define MCU_E_PARAM_CLOCK ((uint8)0x0BU)
  397. #endif
  398. #define MCU_E_PARAM_MODE ((uint8)0x0CU)
  399. #ifndef MCU_MAX_NORAMCONFIGS
  400. #define MCU_E_PARAM_RAMSECTION ((uint8)0x0DU)
  401. #endif
  402. #if (MCU_INIT_CLOCK == STD_ON) && (MCU_NO_PLL == STD_OFF)
  403. #define MCU_E_PLL_NOT_LOCKED ((uint8)0x0EU)
  404. #endif
  405. #define MCU_E_UNINIT ((uint8)0x0FU)
  406. #if (MCU_VERSION_INFO_API == STD_ON) || (MCU_GET_MIDR_API == STD_ON)
  407. #define MCU_E_PARAM_POINTER ((uint8)0x10U)
  408. #endif
  409. #define MCU_E_INIT_FAILED ((uint8)0x11U)
  410. #define MCU_E_ALREADY_INITIALIZED ((uint8)0x13U)
  411. #if (MCU_DISABLE_CMU_API == STD_ON)
  412. #define MCU_E_CMU_INDEX_OUT_OF_RANGE ((uint8)0x22U)
  413. #endif
  414. /**@}*/
  415. #endif /* (MCU_DEV_ERROR_DETECT == STD_ON) */
  416. #ifdef MCU_ERROR_ISR_NOTIFICATION
  417. /**
  418. @{
  419. * @brief Error ISR values are of type uint8.
  420. * The following error codes are reported by the error ISR.
  421. */
  422. #if (MCU_CMU_ERROR_ISR_USED == STD_ON)
  423. #define MCU_E_ISR_CLOCK_FAILURE ((uint8)0x01U)
  424. #endif
  425. #endif /* MCU_ERROR_ISR_NOTIFICATION */
  426. /*==================================================================================================
  427. STRUCTURES AND OTHER TYPEDEFS
  428. ==================================================================================================*/
  429. /**
  430. * @brief The Mcu_ModeType specifies the identification (ID) for a MCU mode, configured via configuration structure.
  431. * @details The type shall be uint8, uint16 or uint32.
  432. *
  433. * @implements Mcu_ModeType_typedef
  434. *
  435. */
  436. typedef uint32 Mcu_ModeType;
  437. /**
  438. * @brief The Mcu_RamSectionType specifies the identification (ID) for a RAM section, configured via the configuration structure.
  439. * The type shall be uint8, uint16 or uint32, based on best performance.
  440. * @implements Mcu_RamSectionType_typedef
  441. */
  442. typedef uint32 Mcu_RamSectionType;
  443. /**
  444. * @brief The Mcu_RamWriteSizeType specifies the RAM section write size.
  445. * The type shall be uint8, uint16 or uint32, based on best performance.
  446. *
  447. */
  448. typedef uint32 Mcu_RamWriteSizeType;
  449. #if (MCU_INIT_CLOCK == STD_ON)
  450. /**
  451. * @brief Defines the identification (ID) for clock setting configured via the configuration structure.
  452. * @details The type shall be uint8, uint16 or uint32, depending on uC platform.
  453. *
  454. * @implements Mcu_ClockType_typedef
  455. */
  456. typedef uint32 Mcu_ClockType;
  457. #endif /* (MCU_INIT_CLOCK == STD_ON) */
  458. /**
  459. * @brief The type Mcu_RawResetType specifies the reset reason in raw register format, read from a reset status register.
  460. * @details The type shall be uint8, uint16 or uint32 based on best performance.
  461. *
  462. * @implements Mcu_RawResetType_typedef
  463. *
  464. */
  465. typedef uint32 Mcu_RawResetType; /**< @brief Destructive and Functional Reset Events Log. */
  466. /**
  467. * @brief DEM error reporting configuration.
  468. * @details This structure contains information DEM error reporting
  469. */
  470. typedef struct
  471. {
  472. Mcal_DemErrorType Mcu_E_TimeoutFailureCfg;
  473. Mcal_DemErrorType Mcu_E_InvalidFxoscConfigCfg;
  474. Mcal_DemErrorType Mcu_E_ClockMuxSwitchFailureCfg;
  475. Mcal_DemErrorType Mcu_E_ClockFailureCfg;
  476. Mcal_DemErrorType Mcu_E_SwitchModeFailureCfg;
  477. } Mcu_DemConfigType;
  478. #if (MCU_POWERMODE_STATE_API == STD_ON)
  479. /**
  480. * @brief State of the current power mode.
  481. * @details Used to store the value of register value.
  482. */
  483. typedef uint32 Mcu_PowerModeStateType;
  484. #endif /* (MCU_POWERMODE_STATE_API == STD_ON) */
  485. /*==================================================================================================
  486. CONSTANTS
  487. ==================================================================================================*/
  488. #if (MCU_INIT_CLOCK == STD_ON)
  489. /**
  490. * @brief Create defines with the IDs assigned to Mcu Clock configurations.
  491. * These IDs will be transmitted as input parameters for Mcu_InitClock() API.
  492. */
  493. #define McuClockSettingConfig_0 ((Mcu_ClockType)0U)
  494. #define McuConf_McuClockSettingConfig_McuClockSettingConfig_0 ((Mcu_ClockType)0U)
  495. #endif
  496. /**
  497. * @brief Create defines with the IDs assigned to Mcu Mode configurations.
  498. * These IDs will be transmitted as input parameters for Mcu_SetMode() API.
  499. */
  500. #define McuModeSettingConf_Run ((Mcu_ModeType)0U)
  501. #define McuConf_McuModeSettingConf_McuModeSettingConf_Run ((Mcu_ModeType)0U)
  502. /**
  503. * @brief Create defines with the IDs assigned to Mcu RAM Section configurations.
  504. * These IDs will be transmitted as input parameters for Mcu_InitRamSection() API.
  505. */
  506. /*==================================================================================================
  507. ENUMS
  508. ==================================================================================================*/
  509. /**
  510. * @brief Type of the return value of the function Mcu_GetPllStatus.
  511. * @details The type of Mcu_PllStatusType is an enumeration with the following values:
  512. * MCU_PLL_LOCKED, MCU_PLL_UNLOCKED, MCU_PLL_STATUS_UNDEFINED.
  513. *
  514. * @implements Mcu_PllStatusType_Enumeration
  515. *
  516. */
  517. typedef enum
  518. {
  519. MCU_PLL_LOCKED = 0x33U, /**< @brief PLL is locked. */
  520. MCU_PLL_UNLOCKED = 0xCCU, /**< @brief PLL is unlocked. */
  521. MCU_PLL_STATUS_UNDEFINED = 0x5AU /**< @brief PLL Status is unknown. */
  522. } Mcu_PllStatusType;
  523. /**
  524. * @brief The type Mcu_ResetType, represents the different reset that a specified MCU can have.
  525. * @details The MCU module shall provide at least the values MCU_POWER_ON_RESET and MCU_RESET_UNDEFINED for the enumeration Mcu_ResetType.
  526. *
  527. * @implements Mcu_ResetType_Enumeration
  528. */
  529. typedef Power_Ip_ResetType Mcu_ResetType;
  530. #if (MCU_GET_RAM_STATE_API == STD_ON)
  531. /**
  532. * @brief Ram State of the microcontroller.
  533. * @details This is the Ram State data type returned by the function Mcu_GetRamState() of the Mcu module.
  534. * @implements Mcu_RamStateType_Enumeration
  535. */
  536. typedef enum
  537. {
  538. MCU_RAMSTATE_INVALID = 0x99U, /**< @brief RAM content is not valid or unknown (default). */
  539. MCU_RAMSTATE_VALID = 0x66U /**< @brief RAM content is valid. */
  540. } Mcu_RamStateType;
  541. #endif /* (MCU_GET_RAM_STATE_API == STD_ON) */
  542. #ifdef MCU_PREPARE_MEMORY_CONFIG
  543. /**
  544. * @brief The stage of the flash and ram controllers configuration.
  545. * @details This is used to specify the entry and exit point of the flash and ram controllers configuration.
  546. */
  547. typedef enum
  548. {
  549. MCU_RAM_MEMORY_CONFIG_ENTRY_POINT = 0x77U,
  550. MCU_RAM_MEMORY_CONFIG_EXIT_POINT = 0x88U
  551. } Mcu_MemoryConfigStageType;
  552. #endif
  553. #if (defined(MCU_PMC_NOTIFICATION) && (MCU_ENTER_LOW_POWER_MODE == STD_ON))
  554. /**
  555. * @brief Power management controller events.
  556. * @details The various events triggered by the power management controller.
  557. */
  558. typedef enum
  559. {
  560. MCU_LAST_MILE_REGULATOR_DISABLED = 0x55U
  561. } Mcu_PowerManagementEventType;
  562. #endif
  563. #ifdef MCU_SLEEPONEXIT_SUPPORT
  564. #if (MCU_SLEEPONEXIT_SUPPORT == STD_ON)
  565. typedef enum
  566. {
  567. MCU_SLEEP_ON_EXIT_DISABLED = 0U, /**< @brief Disable SLEEPONEXIT bit (default). */
  568. MCU_SLEEP_ON_EXIT_ENABLED /**< @brief Enable SLEEPONEXIT bit. */
  569. } Mcu_SleepOnExitType;
  570. #endif
  571. #endif
  572. #if (MCU_SRAM_RETEN_CONFIG_API ==STD_ON)
  573. /**
  574. * @brief Type of parameter value of the function Mcu_SRAMRetentionConfig.
  575. * @details The type of Mcu_SRAMRetenConfigType is an enumeration with the following values:
  576. * MCU_SRAML_RETEN, MCU_SRAMU_RETEN, MCU_SRAMLU_RETEN, MCU_NO_SRAMLU_RETEN.
  577. */
  578. typedef Power_Ip_SRAMRetenConfigType Mcu_SRAMRetenConfigType;
  579. #endif
  580. /*==================================================================================================
  581. DEFINES AND MACROS
  582. ==================================================================================================*/
  583. /**
  584. * @brief This macro is used to define the position of the first reset reason.
  585. *
  586. */
  587. #define MCU_FIRST_RESET_REASON_POS_U32 ((uint32)MCU_POWER_ON_RESET)
  588. /*==================================================================================================
  589. GLOBAL VARIABLE DECLARATIONS
  590. ==================================================================================================*/
  591. #if (MCU_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)
  592. #define MCU_START_SEC_VAR_CLEARED_UNSPECIFIED
  593. #include "Mcu_MemMap.h"
  594. /**
  595. * @brief Local copy of the pointer to the configuration data
  596. */
  597. extern const Mcu_DemConfigType * Mcu_pDemCfgPtr;
  598. #define MCU_STOP_SEC_VAR_CLEARED_UNSPECIFIED
  599. #include "Mcu_MemMap.h"
  600. #define MCU_START_SEC_CONFIG_DATA_UNSPECIFIED
  601. #include "Mcu_MemMap.h"
  602. extern const Mcu_DemConfigType Mcu_Dem_Config;
  603. #define MCU_STOP_SEC_CONFIG_DATA_UNSPECIFIED
  604. #include "Mcu_MemMap.h"
  605. #endif /* (MCU_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF) */
  606. /*==================================================================================================
  607. * FUNCTION PROTOTYPES
  608. ==================================================================================================*/
  609. #define MCU_START_SEC_CODE
  610. #include "Mcu_MemMap.h"
  611. #define MCU_STOP_SEC_CODE
  612. #include "Mcu_MemMap.h"
  613. #ifdef __cplusplus
  614. }
  615. #endif
  616. #endif /* #ifndef MCU_CFG_H */
  617. /** @} */