Clock_Ip_Gate.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  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 Clock_Ip_Gate.c
  26. * @version 1.0.0
  27. *
  28. * @brief CLOCK driver implementations.
  29. * @details CLOCK driver implementations.
  30. *
  31. * @addtogroup CLOCK_DRIVER Clock Ip Driver
  32. * @{
  33. */
  34. #include "Clock_Ip_Private.h"
  35. /*==================================================================================================
  36. SOURCE FILE VERSION INFORMATION
  37. ==================================================================================================*/
  38. #define CLOCK_IP_GATE_VENDOR_ID_C 43
  39. #define CLOCK_IP_GATE_AR_RELEASE_MAJOR_VERSION_C 4
  40. #define CLOCK_IP_GATE_AR_RELEASE_MINOR_VERSION_C 4
  41. #define CLOCK_IP_GATE_AR_RELEASE_REVISION_VERSION_C 0
  42. #define CLOCK_IP_GATE_SW_MAJOR_VERSION_C 1
  43. #define CLOCK_IP_GATE_SW_MINOR_VERSION_C 0
  44. #define CLOCK_IP_GATE_SW_PATCH_VERSION_C 0
  45. /*==================================================================================================
  46. * FILE VERSION CHECKS
  47. ==================================================================================================*/
  48. /* Check if Clock_Ip_Gate.c file and Clock_Ip_Private.h file are of the same vendor */
  49. #if (CLOCK_IP_GATE_VENDOR_ID_C != CLOCK_IP_PRIVATE_VENDOR_ID)
  50. #error "Clock_Ip_Gate.c and Clock_Ip_Private.h have different vendor ids"
  51. #endif
  52. /* Check if Clock_Ip_Gate.c file and Clock_Ip_Private.h file are of the same Autosar version */
  53. #if ((CLOCK_IP_GATE_AR_RELEASE_MAJOR_VERSION_C != CLOCK_IP_PRIVATE_AR_RELEASE_MAJOR_VERSION) || \
  54. (CLOCK_IP_GATE_AR_RELEASE_MINOR_VERSION_C != CLOCK_IP_PRIVATE_AR_RELEASE_MINOR_VERSION) || \
  55. (CLOCK_IP_GATE_AR_RELEASE_REVISION_VERSION_C != CLOCK_IP_PRIVATE_AR_RELEASE_REVISION_VERSION) \
  56. )
  57. #error "AutoSar Version Numbers of Clock_Ip_Gate.c and Clock_Ip_Private.h are different"
  58. #endif
  59. /* Check if Clock_Ip_Gate.c file and Clock_Ip_Private.h file are of the same Software version */
  60. #if ((CLOCK_IP_GATE_SW_MAJOR_VERSION_C != CLOCK_IP_PRIVATE_SW_MAJOR_VERSION) || \
  61. (CLOCK_IP_GATE_SW_MINOR_VERSION_C != CLOCK_IP_PRIVATE_SW_MINOR_VERSION) || \
  62. (CLOCK_IP_GATE_SW_PATCH_VERSION_C != CLOCK_IP_PRIVATE_SW_PATCH_VERSION) \
  63. )
  64. #error "Software Version Numbers of Clock_Ip_Gate.c and Clock_Ip_Private.h are different"
  65. #endif
  66. /* Clock start section code */
  67. #define MCU_START_SEC_CODE
  68. #include "Mcu_MemMap.h"
  69. static void ClockSetGateEmpty(Clock_Ip_GateConfigType const* config);
  70. static void ClockUpdateGateEmpty(Clock_Ip_NameType clockName, boolean gate);
  71. #ifdef MC_ME_PARTITION_COFB_ENABLE_REQUEST
  72. static void ClockSetGateMcMePartitionCollectionClockRequest(Clock_Ip_GateConfigType const* config);
  73. static void ClockUpdateGateMcMePartitionCollectionClockRequest(Clock_Ip_NameType clockName, boolean gate);
  74. #endif
  75. #ifdef SIM_LPO1K_ENABLE
  76. static void ClockSetSimLPO1KEnable(Clock_Ip_GateConfigType const* config);
  77. static void ClockUpdateSimLPO1KEnable(Clock_Ip_NameType clockName, boolean gate);
  78. #endif
  79. #ifdef SIM_LPO32K_ENABLE
  80. static void ClockSetSimLPO32KEnable(Clock_Ip_GateConfigType const* config);
  81. static void ClockUpdateSimLPO32KEnable(Clock_Ip_NameType clockName, boolean gate);
  82. #endif
  83. #ifdef SIM_CLKOUT_ENABLE
  84. static void ClockSetSimClkoutEnable(Clock_Ip_GateConfigType const* config);
  85. static void ClockUpdateSimClkoutEnable(Clock_Ip_NameType clockName, boolean gate);
  86. #endif
  87. #ifdef PCC_CGC_ENABLE
  88. static void ClockSetPccCgcEnable(Clock_Ip_GateConfigType const* config);
  89. static void ClockUpdatePccCgcEnable(Clock_Ip_NameType clockName, boolean gate);
  90. #endif
  91. #ifdef SIM_PLATCGC_CGC
  92. static void ClockSetSimGate(Clock_Ip_GateConfigType const* config);
  93. static void ClockUpdateSimGate(Clock_Ip_NameType clockName, boolean gate);
  94. #endif
  95. #ifdef SIM_TRACE_ENABLE
  96. static void ClockSetSimTraceEnable(Clock_Ip_GateConfigType const* config);
  97. static void ClockUpdateSimTraceEnable(Clock_Ip_NameType clockName, boolean gate);
  98. #endif
  99. #ifdef CLOCK_CONTROL_ENABLE_GPR_PCTL
  100. static void ClockSetGateClockControlEnableGprPctl(Clock_Ip_GateConfigType const* config);
  101. static void ClockUpdateGateClockControlEnableGprPctl(Clock_Ip_NameType clockName, boolean gate);
  102. #endif
  103. /* Clock stop section code */
  104. #define MCU_STOP_SEC_CODE
  105. #include "Mcu_MemMap.h"
  106. /* Clock start constant section data */
  107. #define MCU_START_SEC_CONST_UNSPECIFIED
  108. #include "Mcu_MemMap.h"
  109. const gateCallback gateCallbacks[GATE_CALLBACKS_COUNT] =
  110. {
  111. {
  112. ClockSetGateEmpty, /* Set */
  113. ClockUpdateGateEmpty, /* Update */
  114. },
  115. #ifdef MC_ME_PARTITION_COFB_ENABLE_REQUEST
  116. {
  117. ClockSetGateMcMePartitionCollectionClockRequest, /* Set */
  118. ClockUpdateGateMcMePartitionCollectionClockRequest, /* Update */
  119. },
  120. #endif
  121. #ifdef PCC_CGC_ENABLE
  122. {
  123. ClockSetPccCgcEnable, /* Set */
  124. ClockUpdatePccCgcEnable, /* Update */
  125. },
  126. #endif
  127. #ifdef SIM_CLKOUT_ENABLE
  128. {
  129. ClockSetSimClkoutEnable, /* Set */
  130. ClockUpdateSimClkoutEnable, /* Update */
  131. },
  132. #endif
  133. #ifdef SIM_LPO32K_ENABLE
  134. {
  135. ClockSetSimLPO32KEnable, /* Set */
  136. ClockUpdateSimLPO32KEnable, /* Update */
  137. },
  138. #endif
  139. #ifdef SIM_LPO1K_ENABLE
  140. {
  141. ClockSetSimLPO1KEnable, /* Set */
  142. ClockUpdateSimLPO1KEnable, /* Update */
  143. },
  144. #endif
  145. #ifdef SIM_PLATCGC_CGC
  146. {
  147. ClockSetSimGate, /* Set */
  148. ClockUpdateSimGate, /* Update */
  149. },
  150. #endif
  151. #ifdef SIM_TRACE_ENABLE
  152. {
  153. ClockSetSimTraceEnable, /* Set */
  154. ClockUpdateSimTraceEnable, /* Update */
  155. },
  156. #endif
  157. #ifdef CLOCK_CONTROL_ENABLE_GPR_PCTL
  158. {
  159. ClockSetGateClockControlEnableGprPctl, /* Set */
  160. ClockUpdateGateClockControlEnableGprPctl, /* Update */
  161. },
  162. #endif
  163. };
  164. /* Clock stop constant section data */
  165. #define MCU_STOP_SEC_CONST_UNSPECIFIED
  166. #include "Mcu_MemMap.h"
  167. /* Clock start section code */
  168. #define MCU_START_SEC_CODE
  169. #include "Mcu_MemMap.h"
  170. static void ClockSetGateEmpty(Clock_Ip_GateConfigType const* config)
  171. {
  172. (void)config;
  173. /* No implementation */
  174. }
  175. static void ClockUpdateGateEmpty(Clock_Ip_NameType clockName, boolean gate)
  176. {
  177. (void)clockName;
  178. (void)gate;
  179. /* No implementation */
  180. }
  181. #ifdef MC_ME_PARTITION_COFB_ENABLE_REQUEST
  182. static void ClockSetGateMcMePartitionCollectionClockRequest(Clock_Ip_GateConfigType const* config)
  183. {
  184. boolean TimeoutOccurred = FALSE;
  185. uint32 StartTime;
  186. uint32 ElapsedTime;
  187. uint32 TimeoutTicks;
  188. const gateInfoType * gateInformation = &gateInfo[clockFeatures[config->name][GATE_INDEX]];
  189. uint32 partition = gateInformation->PARTITION_VALUE;
  190. uint32 collection = gateInformation->COLLECTION_VALUE;
  191. uint32 enableRequest = gateInformation->REQUEST_VALUE_MASK;
  192. if (config->enable != 0U)
  193. {
  194. if ((mcmeGetPartitions[partition]->PRTN_COFB_STAT[collection] & enableRequest) == 0U)
  195. {
  196. mcmeSetPartitions[partition]->PRTN_COFB_CLKEN[collection] |= enableRequest;
  197. mcmeTriggerPartitions[partition]->PRTN_PCONF |= MC_ME_PRTN1_PCONF_PCE_MASK;
  198. mcmeTriggerPartitions[partition]->PRTN_PUPD |= MC_ME_PRTN1_PUPD_PCUD_MASK;
  199. McMeEnterKey();
  200. /* Wait until clock gate is updated */
  201. ClockStartTimeout(&StartTime, &ElapsedTime, &TimeoutTicks, CLOCK_TIMEOUT_VALUE_US);
  202. do
  203. {
  204. TimeoutOccurred = ClockTimeoutExpired(&StartTime, &ElapsedTime, TimeoutTicks);
  205. }
  206. while (((mcmeGetPartitions[partition]->PRTN_COFB_STAT[collection] & enableRequest) == 0U) && (FALSE == TimeoutOccurred));
  207. /* timeout notification */
  208. if (TRUE == TimeoutOccurred)
  209. {
  210. /* Report timeout error */
  211. ReportClockErrors(CLOCK_IP_REPORT_TIMEOUT_ERROR, config->name);
  212. }
  213. }
  214. }
  215. else
  216. {
  217. if ((mcmeGetPartitions[partition]->PRTN_COFB_STAT[collection] & enableRequest) != 0U)
  218. {
  219. mcmeSetPartitions[partition]->PRTN_COFB_CLKEN[collection] &= (~enableRequest);
  220. mcmeTriggerPartitions[partition]->PRTN_PCONF |= MC_ME_PRTN1_PCONF_PCE_MASK;
  221. mcmeTriggerPartitions[partition]->PRTN_PUPD |= MC_ME_PRTN1_PUPD_PCUD_MASK;
  222. McMeEnterKey();
  223. /* Wait until clock gate is updated */
  224. ClockStartTimeout(&StartTime, &ElapsedTime, &TimeoutTicks, CLOCK_TIMEOUT_VALUE_US);
  225. do
  226. {
  227. TimeoutOccurred = ClockTimeoutExpired(&StartTime, &ElapsedTime, TimeoutTicks);
  228. }
  229. while (((mcmeGetPartitions[partition]->PRTN_COFB_STAT[collection] & enableRequest) != 0U) && (FALSE == TimeoutOccurred));
  230. /* timeout notification */
  231. if (TRUE == TimeoutOccurred)
  232. {
  233. /* Report timeout error */
  234. ReportClockErrors(CLOCK_IP_REPORT_TIMEOUT_ERROR, config->name);
  235. }
  236. }
  237. }
  238. }
  239. static void ClockUpdateGateMcMePartitionCollectionClockRequest(Clock_Ip_NameType clockName, boolean gate)
  240. {
  241. Clock_Ip_GateConfigType config;
  242. config.name = clockName;
  243. if (gate == TRUE)
  244. {
  245. config.enable = 0U;
  246. }
  247. else
  248. {
  249. config.enable = 1U;
  250. }
  251. /* Write configuration to register */
  252. ClockSetGateMcMePartitionCollectionClockRequest(&config);
  253. }
  254. #endif
  255. #ifdef SIM_LPO1K_ENABLE
  256. /* Write configuration of clock gate to register */
  257. static void ClockSetSimLPO1KEnable_TrustedCall(Clock_Ip_GateConfigType const* config)
  258. {
  259. uint32 regValue;
  260. regValue = IP_SIM->LPOCLKS;
  261. regValue &= ~SIM_LPOCLKS_LPO1KCLKEN_MASK;
  262. regValue |= ((uint32)(config->enable) << SIM_LPOCLKS_LPO1KCLKEN_SHIFT);
  263. IP_SIM->LPOCLKS = regValue;
  264. }
  265. static void ClockSetSimLPO1KEnable(Clock_Ip_GateConfigType const* config)
  266. {
  267. #ifdef CLOCK_IP_ENABLE_USER_MODE_SUPPORT
  268. #if (STD_ON == CLOCK_IP_ENABLE_USER_MODE_SUPPORT)
  269. OsIf_Trusted_Call1param(ClockSetSimLPO1KEnable_TrustedCall,(config));
  270. #else
  271. ClockSetSimLPO1KEnable_TrustedCall(config);
  272. #endif
  273. #endif /* CLOCK_IP_ENABLE_USER_MODE_SUPPORT */
  274. }
  275. static void ClockUpdateSimLPO1KEnable(Clock_Ip_NameType clockName, boolean gate)
  276. {
  277. Clock_Ip_GateConfigType config;
  278. config.name = clockName;
  279. if (gate == TRUE)
  280. {
  281. config.enable = 0U;
  282. }
  283. else
  284. {
  285. config.enable = 1U;
  286. }
  287. /* Write configuration to register */
  288. ClockSetSimLPO1KEnable(&config);
  289. }
  290. #endif
  291. #ifdef SIM_LPO32K_ENABLE
  292. /* Write configuration of clock gate to register */
  293. static void ClockSetSimLPO32KEnable_TrustedCall(Clock_Ip_GateConfigType const* config)
  294. {
  295. uint32 regValue;
  296. regValue = IP_SIM->LPOCLKS;
  297. regValue &= ~SIM_LPOCLKS_LPO32KCLKEN_MASK;
  298. regValue |= ((uint32)(config->enable) << SIM_LPOCLKS_LPO32KCLKEN_SHIFT);
  299. IP_SIM->LPOCLKS = regValue;
  300. }
  301. static void ClockSetSimLPO32KEnable(Clock_Ip_GateConfigType const* config)
  302. {
  303. #ifdef CLOCK_IP_ENABLE_USER_MODE_SUPPORT
  304. #if (STD_ON == CLOCK_IP_ENABLE_USER_MODE_SUPPORT)
  305. OsIf_Trusted_Call1param(ClockSetSimLPO32KEnable_TrustedCall,(config));
  306. #else
  307. ClockSetSimLPO32KEnable_TrustedCall(config);
  308. #endif
  309. #endif /* CLOCK_IP_ENABLE_USER_MODE_SUPPORT */
  310. }
  311. static void ClockUpdateSimLPO32KEnable(Clock_Ip_NameType clockName, boolean gate)
  312. {
  313. Clock_Ip_GateConfigType config;
  314. config.name = clockName;
  315. if (gate == TRUE)
  316. {
  317. config.enable = 0U;
  318. }
  319. else
  320. {
  321. config.enable = 1U;
  322. }
  323. /* Write configuration to register */
  324. ClockSetSimLPO32KEnable(&config);
  325. }
  326. #endif
  327. #ifdef SIM_CLKOUT_ENABLE
  328. /* Write configuration of clock gate to register */
  329. static void ClockSetSimClkoutEnable_TrustedCall(Clock_Ip_GateConfigType const* config)
  330. {
  331. uint32 regValue;
  332. regValue = IP_SIM->CHIPCTL;
  333. regValue &= ~SIM_CHIPCTL_CLKOUTEN_MASK;
  334. regValue |= ((uint32)(config->enable) << SIM_CHIPCTL_CLKOUTEN_SHIFT);
  335. IP_SIM->CHIPCTL = regValue;
  336. }
  337. static void ClockSetSimClkoutEnable(Clock_Ip_GateConfigType const* config)
  338. {
  339. #ifdef CLOCK_IP_ENABLE_USER_MODE_SUPPORT
  340. #if (STD_ON == CLOCK_IP_ENABLE_USER_MODE_SUPPORT)
  341. OsIf_Trusted_Call1param(ClockSetSimClkoutEnable_TrustedCall,(config));
  342. #else
  343. ClockSetSimClkoutEnable_TrustedCall(config);
  344. #endif
  345. #endif /* CLOCK_IP_ENABLE_USER_MODE_SUPPORT */
  346. }
  347. static void ClockUpdateSimClkoutEnable(Clock_Ip_NameType clockName, boolean gate)
  348. {
  349. Clock_Ip_GateConfigType config;
  350. config.name = clockName;
  351. if (gate == TRUE)
  352. {
  353. config.enable = 0U;
  354. }
  355. else
  356. {
  357. config.enable = 1U;
  358. }
  359. /* Write configuration to register */
  360. ClockSetSimClkoutEnable(&config);
  361. }
  362. #endif
  363. #ifdef PCC_CGC_ENABLE
  364. /* Write configuration of clock gate to register */
  365. static void ClockSetPccCgcEnable_TrustedCall(Clock_Ip_GateConfigType const* config)
  366. {
  367. uint32 regValue;
  368. regValue = IP_PCC->PCCn[clockFeatures[config->name][GATE_INDEX]];
  369. regValue &= ~PCC_PCCn_CGC_MASK;
  370. regValue |= ((uint32)(config->enable) << PCC_PCCn_CGC_SHIFT);
  371. IP_PCC->PCCn[clockFeatures[config->name][GATE_INDEX]] = regValue;
  372. }
  373. static void ClockSetPccCgcEnable(Clock_Ip_GateConfigType const* config)
  374. {
  375. #ifdef CLOCK_IP_ENABLE_USER_MODE_SUPPORT
  376. #if (STD_ON == CLOCK_IP_ENABLE_USER_MODE_SUPPORT)
  377. OsIf_Trusted_Call1param(ClockSetPccCgcEnable_TrustedCall,(config));
  378. #else
  379. ClockSetPccCgcEnable_TrustedCall(config);
  380. #endif
  381. #endif /* CLOCK_IP_ENABLE_USER_MODE_SUPPORT */
  382. }
  383. static void ClockUpdatePccCgcEnable(Clock_Ip_NameType clockName, boolean gate)
  384. {
  385. Clock_Ip_GateConfigType config;
  386. config.name = clockName;
  387. if (gate == TRUE)
  388. {
  389. config.enable = 0U;
  390. }
  391. else
  392. {
  393. config.enable = 1U;
  394. }
  395. /* Write configuration to register */
  396. ClockSetPccCgcEnable(&config);
  397. }
  398. #endif
  399. #ifdef SIM_PLATCGC_CGC
  400. #define SIM_PLATCGC_CGC_SHIFT(x) (x)
  401. #define SIM_PLATCGC_CGC_MASK(x) ((uint32)1U << (x))
  402. /* Write configuration of clock gate to register */
  403. static void ClockSetSimGate_TrustedCall(Clock_Ip_GateConfigType const* config)
  404. {
  405. uint32 enable = config->enable;
  406. uint32 gateIndex = clockFeatures[config->name][GATE_INDEX];
  407. uint32 regValue = (uint32 )IP_SIM->PLATCGC;
  408. regValue &= (~((uint32 )SIM_PLATCGC_CGC_MASK(gateIndex)));
  409. regValue |= enable << SIM_PLATCGC_CGC_SHIFT(gateIndex);
  410. IP_SIM->PLATCGC = (uint32 )regValue;
  411. }
  412. static void ClockSetSimGate(Clock_Ip_GateConfigType const* config)
  413. {
  414. #ifdef CLOCK_IP_ENABLE_USER_MODE_SUPPORT
  415. #if (STD_ON == CLOCK_IP_ENABLE_USER_MODE_SUPPORT)
  416. OsIf_Trusted_Call1param(ClockSetSimGate_TrustedCall,(config));
  417. #else
  418. ClockSetSimGate_TrustedCall(config);
  419. #endif
  420. #endif /* CLOCK_IP_ENABLE_USER_MODE_SUPPORT */
  421. }
  422. static void ClockUpdateSimGate(Clock_Ip_NameType clockName, boolean gate)
  423. {
  424. Clock_Ip_GateConfigType config;
  425. config.name = clockName;
  426. if (gate == TRUE)
  427. {
  428. config.enable = 0U;
  429. }
  430. else
  431. {
  432. config.enable = 1U;
  433. }
  434. /* Write configuration to register */
  435. ClockSetSimGate(&config);
  436. }
  437. #endif
  438. #ifdef SIM_TRACE_ENABLE
  439. /* Write configuration of clock gate to register */
  440. static void ClockSetSimTraceEnable_TrustedCall(Clock_Ip_GateConfigType const* config)
  441. {
  442. uint32 regValue;
  443. regValue = IP_SIM->CLKDIV4;
  444. if (config->enable == 1U)
  445. {
  446. regValue |= (SIM_CLKDIV4_TRACEDIVEN_MASK);
  447. }
  448. else
  449. {
  450. regValue &= ~(SIM_CLKDIV4_TRACEDIVEN_MASK);
  451. }
  452. IP_SIM->CLKDIV4 = regValue;
  453. }
  454. static void ClockSetSimTraceEnable(Clock_Ip_GateConfigType const* config)
  455. {
  456. #ifdef CLOCK_IP_ENABLE_USER_MODE_SUPPORT
  457. #if (STD_ON == CLOCK_IP_ENABLE_USER_MODE_SUPPORT)
  458. OsIf_Trusted_Call1param(ClockSetSimTraceEnable_TrustedCall,(config));
  459. #else
  460. ClockSetSimTraceEnable_TrustedCall(config);
  461. #endif
  462. #endif /* CLOCK_IP_ENABLE_USER_MODE_SUPPORT */
  463. }
  464. static void ClockUpdateSimTraceEnable(Clock_Ip_NameType clockName, boolean gate)
  465. {
  466. Clock_Ip_GateConfigType config;
  467. config.name = clockName;
  468. if (gate == TRUE)
  469. {
  470. config.enable = 0U;
  471. }
  472. else
  473. {
  474. config.enable = 1U;
  475. }
  476. /* Write configuration to register */
  477. ClockSetSimTraceEnable(&config);
  478. }
  479. #endif
  480. #ifdef CLOCK_CONTROL_ENABLE_GPR_PCTL
  481. /* Write configuration of clock gate to register */
  482. static void ClockSetGateClockControlEnableGprPctl(Clock_Ip_GateConfigType const* config)
  483. {
  484. const gateInfoType * gateInformation = &gateInfo[clockFeatures[config->name][GATE_INDEX]];
  485. uint32 groupIndex = gateInformation->pGroupIndex;
  486. uint32 gateIndex = gateInformation->pGateIndex;
  487. if (config->enable != 0U)
  488. {
  489. gprClockControlEnable[groupIndex]->PCTL[gateIndex] |= GPR_PCTL_MASK;
  490. }
  491. else
  492. {
  493. gprClockControlEnable[groupIndex]->PCTL[gateIndex] &= ~GPR_PCTL_MASK;
  494. }
  495. }
  496. static void ClockUpdateGateClockControlEnableGprPctl(Clock_Ip_NameType clockName, boolean gate)
  497. {
  498. Clock_Ip_GateConfigType config;
  499. config.name = clockName;
  500. if (gate == TRUE)
  501. {
  502. config.enable = 0U;
  503. }
  504. else
  505. {
  506. config.enable = 1U;
  507. }
  508. /* Write configuration to register */
  509. ClockSetGateClockControlEnableGprPctl(&config);
  510. }
  511. #endif
  512. /* Clock stop section code */
  513. #define MCU_STOP_SEC_CODE
  514. #include "Mcu_MemMap.h"
  515. /*! @}*/
  516. /*******************************************************************************
  517. * EOF
  518. ******************************************************************************/