Flexio_Mcl_Ip_HwAccess.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : DMA,CACHE,TRGMUX,FLEXIO
  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 Flexio_Mcl_Ip_HwAccess.c
  26. *
  27. * @version 1.0.0
  28. *
  29. * @brief AUTOSAR Mcl - Flexio Common driver source file.
  30. * @details
  31. *
  32. * @addtogroup FLEXIO_IP_DRIVER FLEXIO IP Driver
  33. * @{
  34. */
  35. #ifdef __cplusplus
  36. extern "C"{
  37. #endif
  38. /*==================================================================================================
  39. * INCLUDE FILES
  40. * 1) system and project includes
  41. * 2) needed interfaces from external units
  42. * 3) internal and external interfaces from this unit
  43. ==================================================================================================*/
  44. #include "Flexio_Mcl_Ip_HwAccess.h"
  45. #include "SchM_Mcl.h"
  46. /*==================================================================================================
  47. * SOURCE FILE VERSION INFORMATION
  48. ==================================================================================================*/
  49. #define FLEXIO_MCL_IP_HWACCESS_VENDOR_ID_C 43
  50. #define FLEXIO_MCL_IP_HWACCESS_AR_RELEASE_MAJOR_VERSION_C 4
  51. #define FLEXIO_MCL_IP_HWACCESS_AR_RELEASE_MINOR_VERSION_C 4
  52. #define FLEXIO_MCL_IP_HWACCESS_AR_RELEASE_REVISION_VERSION_C 0
  53. #define FLEXIO_MCL_IP_HWACCESS_SW_MAJOR_VERSION_C 1
  54. #define FLEXIO_MCL_IP_HWACCESS_SW_MINOR_VERSION_C 0
  55. #define FLEXIO_MCL_IP_HWACCESS_SW_PATCH_VERSION_C 0
  56. /*==================================================================================================
  57. * FILE VERSION CHECKS
  58. ==================================================================================================*/
  59. /* Check if Flexio_Mcl_Ip_HwAccess.c file and Flexio_Mcl_Ip_HwAccess.h file are of the same vendor */
  60. #if (FLEXIO_MCL_IP_HWACCESS_VENDOR_ID_C != FLEXIO_IP_HW_ACCESS_VENDOR_ID_H)
  61. #error "Flexio_Mcl_Ip_HwAccess.c and Flexio_Mcl_Ip_HwAccess.h have different vendor ids"
  62. #endif
  63. /* Check if Flexio_Mcl_Ip_HwAccess.c file and Flexio_Mcl_Ip_HwAccess.h file are of the same Autosar version */
  64. #if ((FLEXIO_MCL_IP_HWACCESS_AR_RELEASE_MAJOR_VERSION_C != FLEXIO_IP_HW_ACCESS_AR_RELEASE_MAJOR_VERSION_H) || \
  65. (FLEXIO_MCL_IP_HWACCESS_AR_RELEASE_MINOR_VERSION_C != FLEXIO_IP_HW_ACCESS_AR_RELEASE_MINOR_VERSION_H) || \
  66. (FLEXIO_MCL_IP_HWACCESS_AR_RELEASE_REVISION_VERSION_C != FLEXIO_IP_HW_ACCESS_AR_RELEASE_REVISION_VERSION_H) \
  67. )
  68. #error "AutoSar Version Numbers of Flexio_Mcl_Ip_HwAccess.c and Flexio_Mcl_Ip_HwAccess.h are different"
  69. #endif
  70. /* Check if Flexio_Mcl_Ip_HwAccess.c file and Flexio_Mcl_Ip_HwAccess.h file are of the same Software version */
  71. #if ((FLEXIO_MCL_IP_HWACCESS_SW_MAJOR_VERSION_C != FLEXIO_IP_HW_ACCESS_SW_MAJOR_VERSION_H) || \
  72. (FLEXIO_MCL_IP_HWACCESS_SW_MINOR_VERSION_C != FLEXIO_IP_HW_ACCESS_SW_MINOR_VERSION_H) || \
  73. (FLEXIO_MCL_IP_HWACCESS_SW_PATCH_VERSION_C != FLEXIO_IP_HW_ACCESS_SW_PATCH_VERSION_H) \
  74. )
  75. #error "Software Version Numbers of Flexio_Mcl_Ip_HwAccess.c and Flexio_Mcl_Ip_HwAccess.h are different"
  76. #endif
  77. /* Check if Flexio_Mcl_Ip_HwAccess.c file and Flexio_Mcl_Ip_Cfg_Defines.h file are of the same vendor */
  78. #if (FLEXIO_MCL_IP_HWACCESS_VENDOR_ID_C != FLEXIO_MCL_IP_CFG_DEFINES_VENDOR_ID_H)
  79. #error "Flexio_Mcl_Ip_HwAccess.c and Flexio_Mcl_Ip_Cfg_Defines.h have different vendor ids"
  80. #endif
  81. /* Check if Flexio_Mcl_Ip_HwAccess.c file and Flexio_Mcl_Ip_Cfg_Defines.h file are of the same Autosar version */
  82. #if ((FLEXIO_MCL_IP_HWACCESS_AR_RELEASE_MAJOR_VERSION_C != FLEXIO_MCL_IP_CFG_DEFINES_AR_RELEASE_MAJOR_VERSION_H) || \
  83. (FLEXIO_MCL_IP_HWACCESS_AR_RELEASE_MINOR_VERSION_C != FLEXIO_MCL_IP_CFG_DEFINES_AR_RELEASE_MINOR_VERSION_H) || \
  84. (FLEXIO_MCL_IP_HWACCESS_AR_RELEASE_REVISION_VERSION_C != FLEXIO_MCL_IP_CFG_DEFINES_AR_RELEASE_REVISION_VERSION_H) \
  85. )
  86. #error "AutoSar Version Numbers of Flexio_Mcl_Ip_HwAccess.c and Flexio_Mcl_Ip_Cfg_Defines.h are different"
  87. #endif
  88. /* Check if Flexio_Mcl_Ip_HwAccess.c file and Flexio_Mcl_Ip_Cfg_Defines.h file are of the same Software version */
  89. #if ((FLEXIO_MCL_IP_HWACCESS_SW_MAJOR_VERSION_C != FLEXIO_MCL_IP_CFG_DEFINES_SW_MAJOR_VERSION_H) || \
  90. (FLEXIO_MCL_IP_HWACCESS_SW_MINOR_VERSION_C != FLEXIO_MCL_IP_CFG_DEFINES_SW_MINOR_VERSION_H) || \
  91. (FLEXIO_MCL_IP_HWACCESS_SW_PATCH_VERSION_C != FLEXIO_MCL_IP_CFG_DEFINES_SW_PATCH_VERSION_H) \
  92. )
  93. #error "Software Version Numbers of Flexio_Mcl_Ip_HwAccess.c and Flexio_Mcl_Ip_Cfg_Defines.h are different"
  94. #endif
  95. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  96. /* Check if Flexio_Mcl_Ip_HwAccess.c file and SchM_Mcl header file are of the same Autosar version */
  97. #if ((FLEXIO_MCL_IP_HWACCESS_AR_RELEASE_MAJOR_VERSION_C != SCHM_MCL_AR_RELEASE_MAJOR_VERSION) || \
  98. (FLEXIO_MCL_IP_HWACCESS_AR_RELEASE_MINOR_VERSION_C != SCHM_MCL_AR_RELEASE_MINOR_VERSION))
  99. #error "AutoSar Version Numbers of Flexio_Mcl_Ip_HwAccess.c and SchM_Mcl.h are different"
  100. #endif
  101. #endif
  102. /*==================================================================================================
  103. * LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
  104. ==================================================================================================*/
  105. /*==================================================================================================
  106. * LOCAL CONSTANTS
  107. ==================================================================================================*/
  108. /*==================================================================================================
  109. * LOCAL VARIABLES
  110. ==================================================================================================*/
  111. /*==================================================================================================
  112. * GLOBAL CONSTANTS
  113. ==================================================================================================*/
  114. /*==================================================================================================
  115. * GLOBAL VARIABLES
  116. ==================================================================================================*/
  117. /*==================================================================================================
  118. * LOCAL FUNCTION PROTOTYPES
  119. ==================================================================================================*/
  120. /*==================================================================================================
  121. * LOCAL FUNCTIONS
  122. ==================================================================================================*/
  123. /*==================================================================================================
  124. * GLOBAL FUNCTIONS PROTOTYPES
  125. ==================================================================================================*/
  126. /*==================================================================================================
  127. GLOBAL FUNCTIONS
  128. ==================================================================================================*/
  129. #define MCL_START_SEC_CODE
  130. #include "Mcl_MemMap.h"
  131. /*
  132. * Calling this function with enable parameter set to TRUE resets all internal
  133. * master logic and registers, except the FlexIO Control Register. The reset state
  134. * persists until this function is called with enable parameter set to false.
  135. */
  136. void Flexio_Mcl_Ip_SetSoftwareReset(FLEXIO_Type *baseAddr, boolean enable)
  137. {
  138. SchM_Enter_Mcl_MCL_EXCLUSIVE_AREA_39();
  139. uint32 regValue = (uint32)baseAddr->CTRL;
  140. regValue &= (~((uint32)FLEXIO_CTRL_SWRST_MASK));
  141. regValue |= FLEXIO_CTRL_SWRST((enable ? 1U : 0U));
  142. baseAddr->CTRL = (uint32)regValue;
  143. SchM_Exit_Mcl_MCL_EXCLUSIVE_AREA_39();
  144. }
  145. /*
  146. * This function enables or disables Debug Enable module.
  147. */
  148. void Flexio_Mcl_Ip_SetDebugEnable(FLEXIO_Type *baseAddr, boolean enable)
  149. {
  150. SchM_Enter_Mcl_MCL_EXCLUSIVE_AREA_40();
  151. uint32 regValue = (uint32)baseAddr->CTRL;
  152. regValue &= (~((uint32)FLEXIO_CTRL_DBGE_MASK));
  153. regValue |= FLEXIO_CTRL_DBGE((enable ? 1U : 0U));
  154. baseAddr->CTRL = (uint32)regValue;
  155. SchM_Exit_Mcl_MCL_EXCLUSIVE_AREA_40();
  156. }
  157. /*
  158. * This function enables or disables the FlexIO module.
  159. */
  160. void Flexio_Mcl_Ip_SetEnable(FLEXIO_Type *baseAddr, boolean enable)
  161. {
  162. SchM_Enter_Mcl_MCL_EXCLUSIVE_AREA_41();
  163. uint32 regValue = (uint32)baseAddr->CTRL;
  164. regValue &= (~((uint32)FLEXIO_CTRL_FLEXEN_MASK));
  165. regValue |= FLEXIO_CTRL_FLEXEN((enable ? 1U : 0U));
  166. baseAddr->CTRL = (uint32)regValue;
  167. SchM_Exit_Mcl_MCL_EXCLUSIVE_AREA_41();
  168. }
  169. /*
  170. * This function returns the value of the status flag for the specified shifter.
  171. * The meaning of the status flag depends on the current mode.
  172. * - Transmit mode: shifter buffer is empty and ready to accept more data
  173. * - Receive mode: shifter buffer is full and received data can be read from it
  174. * - Match Store mode: match occurred between shifter buffer and shifter
  175. * - Match Continuous mode: current match result between shifter buffer and shifter
  176. */
  177. boolean Flexio_Mcl_Ip_GetShifterStatus(const FLEXIO_Type *baseAddr, uint8 shifter)
  178. {
  179. return ((((baseAddr->SHIFTSTAT >> shifter) & 1U) != 0U) ? TRUE : FALSE);
  180. }
  181. /*
  182. * This function returns the value of the status flags for all shifters. Each bit in
  183. * the returned value specifies the status for one shifter, starting with
  184. * shifter 0 from least significant bit.
  185. * The meaning of the status flag depends on the current mode.
  186. * - Transmit mode: shifter buffer is empty and ready to accept more data
  187. * - Receive mode: shifter buffer is full and received data can be read from it
  188. * - Match Store mode: match occurred between shifter buffer and shifter
  189. * - Match Continuous mode: current match result between shifter buffer and shifter
  190. */
  191. uint32 Flexio_Mcl_Ip_GetAllShifterStatus(const FLEXIO_Type *baseAddr)
  192. {
  193. return baseAddr->SHIFTSTAT;
  194. }
  195. /*
  196. * This function clears the status flag for the specified shifter. This is possible in
  197. * all modes except Match Continuous mode.
  198. */
  199. void Flexio_Mcl_Ip_ClearShifterStatus(FLEXIO_Type *baseAddr, uint8 shifter)
  200. {
  201. baseAddr->SHIFTSTAT = 1UL << shifter;
  202. }
  203. /*
  204. * This function returns the value of the error status flag for the specified shifter.
  205. * The meaning of the error status flag depends on the current mode.
  206. * - Transmit mode: shifter buffer was not written before it was transferred in the shifter (buffer overrun)
  207. * - Receive mode: shifter buffer was not read before new data was transferred from the shifter (buffer underrun)
  208. * - Match Store mode: match event occurred before the previous match data was read from shifter buffer (buffer overrun)
  209. * - Match Continuous mode: match occurred between shifter buffer and shifter
  210. */
  211. boolean Flexio_Mcl_Ip_GetShifterErrorStatus(const FLEXIO_Type *baseAddr, uint8 shifter)
  212. {
  213. return ((((baseAddr->SHIFTERR >> shifter) & 1U) != 0U) ? TRUE : FALSE);
  214. }
  215. /*
  216. * This function returns the value of the error status flags for all shifters. Each bit in
  217. * the returned value specifies the error status for one shifter, starting with
  218. * shifter 0 from least significant bit.
  219. * The meaning of the error status flag depends on the current mode.
  220. * - Transmit mode: shifter buffer was not written before it was transferred in the shifter (buffer overrun)
  221. * - Receive mode: shifter buffer was not read before new data was transferred from the shifter (buffer underrun)
  222. * - Match Store mode: match event occurred before the previous match data was read from shifter buffer (buffer overrun)
  223. * - Match Continuous mode: match occurred between shifter buffer and shifter
  224. */
  225. uint32 Flexio_Mcl_Ip_GetAllShifterErrorStatus(const FLEXIO_Type *baseAddr)
  226. {
  227. return baseAddr->SHIFTERR;
  228. }
  229. /*
  230. * This function clears the error status flag for the specified shifter.
  231. */
  232. void Flexio_Mcl_Ip_ClearShifterErrorStatus(FLEXIO_Type *baseAddr, uint8 shifter)
  233. {
  234. baseAddr->SHIFTERR = 1UL << shifter;
  235. }
  236. /*
  237. * This function returns the value of the status flag for the specified timer.
  238. * The meaning of the status flag depends on the current mode.
  239. * - 8-bit counter mode: the timer status flag is set when the upper 8-bit counter equals zero
  240. * and decrements. This also causes the counter to reload with the value in the compare register.
  241. * - 8-bit PWM mode: the upper 8-bit counter equals zero and decrements. This also causes the
  242. * counter to reload with the value in the compare register.
  243. * - 16-bit counter mode: the 16-bit counter equals zero and decrements. This also causes the
  244. * counter to reload with the value in the compare register.
  245. */
  246. boolean Flexio_Mcl_Ip_GetTimerStatus(const FLEXIO_Type *baseAddr, uint8 timer)
  247. {
  248. return ((((baseAddr->TIMSTAT >> timer) & 1U) != 0U) ? TRUE : FALSE);
  249. }
  250. boolean Flexio_Mcl_Ip_GetTimerInterruptEnable(const FLEXIO_Type *baseAddr, uint8 timer)
  251. {
  252. /* Get TIMIEN bit value */
  253. return ((((baseAddr->TIMIEN >> timer) & 1U) != 0U) ? TRUE : FALSE);
  254. }
  255. /*
  256. * This function returns the value of the status flags for all timers. Each bit in
  257. * the returned value specifies the status for one timer, starting with
  258. * timer 0 from least significant bit.
  259. * The meaning of the status flag depends on the current mode.
  260. * - 8-bit counter mode: the timer status flag is set when the upper 8-bit counter equals zero
  261. * and decrements. This also causes the counter to reload with the value in the compare register.
  262. * - 8-bit PWM mode: the upper 8-bit counter equals zero and decrements. This also causes the
  263. * counter to reload with the value in the compare register.
  264. * - 16-bit counter mode: the 16-bit counter equals zero and decrements. This also causes the
  265. * counter to reload with the value in the compare register.
  266. */
  267. uint32 Flexio_Mcl_Ip_GetAllTimerStatus(const FLEXIO_Type *baseAddr)
  268. {
  269. return baseAddr->TIMSTAT;
  270. }
  271. /*
  272. * This function clears the status flag for the specified timer.
  273. */
  274. void Flexio_Mcl_Ip_ClearTimerStatus(FLEXIO_Type *baseAddr, uint8 timer)
  275. {
  276. baseAddr->TIMSTAT = 1UL << timer;
  277. }
  278. /*
  279. * Returns the state of the interrupt for all shifters. Each bit in
  280. * the returned value specifies the interrupt state for one shifter, starting with
  281. * shifter 0 from least significant bit.
  282. */
  283. uint32 Flexio_Mcl_Ip_GetAllShifterInterrupt(const FLEXIO_Type *baseAddr)
  284. {
  285. return baseAddr->SHIFTSIEN;
  286. }
  287. /*
  288. * Returns the state of the error interrupt for all shifters. Each bit in
  289. * the returned value specifies the interrupt state for one shifter, starting with
  290. * shifter 0 from least significant bit.
  291. */
  292. uint32 Flexio_Mcl_Ip_GetAllShifterErrorInterrupt(const FLEXIO_Type *baseAddr)
  293. {
  294. return baseAddr->SHIFTEIEN;
  295. }
  296. /*
  297. * Enable or disable specified shifter error interrupts. The interrupt mask must contain a
  298. * bit of 1 for each shifter who's error interrupt must be enabled or disabled.
  299. */
  300. void Flexio_Mcl_Ip_SetShifterErrorInterrupt(FLEXIO_Type *baseAddr, uint8 interruptMask, boolean enable)
  301. {
  302. uint32 tmp;
  303. SchM_Enter_Mcl_MCL_EXCLUSIVE_AREA_42();
  304. tmp = baseAddr->SHIFTEIEN;
  305. if (enable == TRUE)
  306. {
  307. tmp |= (uint32)interruptMask;
  308. }
  309. else
  310. {
  311. tmp &= ~(uint32)interruptMask;
  312. }
  313. baseAddr->SHIFTEIEN = tmp;
  314. SchM_Exit_Mcl_MCL_EXCLUSIVE_AREA_42();
  315. }
  316. /*
  317. * Enable or disable specified shifter interrupts. The interrupt mask must contain a
  318. * bit of 1 for each shifter who's interrupt must be enabled or disabled.
  319. */
  320. void Flexio_Mcl_Ip_SetShifterInterrupt(FLEXIO_Type *baseAddr, uint8 interruptMask, boolean enable)
  321. {
  322. uint32 tmp;
  323. SchM_Enter_Mcl_MCL_EXCLUSIVE_AREA_43();
  324. tmp = baseAddr->SHIFTSIEN;
  325. if (enable == TRUE)
  326. {
  327. tmp |= (uint32)interruptMask;
  328. }
  329. else
  330. {
  331. tmp &= ~(uint32)interruptMask;
  332. }
  333. baseAddr->SHIFTSIEN = tmp;
  334. SchM_Exit_Mcl_MCL_EXCLUSIVE_AREA_43();
  335. }
  336. #if (FLEXIO_MCL_IP_PIN_STS_IS_AVAILABLE == STD_ON)
  337. /*
  338. * This function returns the content of PINSTAT register
  339. */
  340. uint32 Flexio_Mcl_Ip_GetAllPinsStatus(const FLEXIO_Type *baseAddr)
  341. {
  342. return baseAddr->PINSTAT;
  343. }
  344. /*
  345. * This function returns the content of PINIEN register
  346. */
  347. uint32 Flexio_Mcl_Ip_GetAllPinsInterrupt(const FLEXIO_Type *baseAddr)
  348. {
  349. return baseAddr->PINIEN;
  350. }
  351. #endif
  352. /*
  353. * Enable or disable specified shifter DMA requests. The request mask must contain a
  354. * bit of 1 for each shifter who's DMA requests must be enabled or disabled.
  355. */
  356. void Flexio_Mcl_Ip_SetShifterDMARequest(FLEXIO_Type *baseAddr, uint8 requestMask, boolean enable)
  357. {
  358. uint32 tmp;
  359. SchM_Enter_Mcl_MCL_EXCLUSIVE_AREA_44();
  360. tmp = baseAddr->SHIFTSDEN;
  361. if (enable == TRUE)
  362. {
  363. tmp |= (uint32)requestMask;
  364. }
  365. else
  366. {
  367. tmp &= ~(uint32)requestMask;
  368. }
  369. baseAddr->SHIFTSDEN = tmp;
  370. SchM_Exit_Mcl_MCL_EXCLUSIVE_AREA_44();
  371. }
  372. /*
  373. * Returns the state of the interrupt for all timers. Each bit in
  374. * the returned value specifies the interrupt state for one timer, starting with
  375. * timer 0 from least significant bit.
  376. */
  377. uint32 Flexio_Mcl_Ip_GetAllTimerInterrupt(const FLEXIO_Type *baseAddr)
  378. {
  379. return baseAddr->TIMIEN;
  380. }
  381. /*
  382. * Enable or disable specified timer interrupts. The interrupt mask must contain a
  383. * bit of 1 for each timer who's interrupt must be enabled or disabled.
  384. */
  385. void Flexio_Mcl_Ip_SetTimerInterrupt(FLEXIO_Type *baseAddr, uint8 interruptMask, boolean enable)
  386. {
  387. uint32 tmp;
  388. SchM_Enter_Mcl_MCL_EXCLUSIVE_AREA_45();
  389. tmp = baseAddr->TIMIEN;
  390. if (enable == TRUE)
  391. {
  392. tmp |= (uint32)interruptMask;
  393. }
  394. else
  395. {
  396. tmp &= ~(uint32)interruptMask;
  397. }
  398. baseAddr->TIMIEN = tmp;
  399. SchM_Exit_Mcl_MCL_EXCLUSIVE_AREA_45();
  400. }
  401. /*
  402. * This function initializes all the registers of the FlexIO module to
  403. * their reset value.
  404. */
  405. void Flexio_Mcl_Ip_Init(FLEXIO_Type *baseAddr)
  406. {
  407. /* Use software reset bit to reset the module */
  408. Flexio_Mcl_Ip_SetSoftwareReset(baseAddr, TRUE);
  409. /* Control register is not affected by software reset */
  410. baseAddr->CTRL = 0x0U;
  411. }
  412. #if (FLEXIO_MCL_IP_TIMERSDEN_IS_AVAILABLE == STD_ON)
  413. /*
  414. * Enable or disable specified timer DMA requests. The request mask must contain a
  415. * bit of 1 for each shifter who's DMA requests must be enabled or disabled.
  416. */
  417. void Flexio_Mcl_Ip_SetTimerDMARequest(FLEXIO_Type *baseAddr, uint8 requestMask, boolean enable)
  418. {
  419. uint32 tmp;
  420. SchM_Enter_Mcl_MCL_EXCLUSIVE_AREA_46();
  421. tmp = baseAddr->TIMERSDEN;
  422. if (enable == TRUE)
  423. {
  424. tmp |= (uint32)requestMask;
  425. }
  426. else
  427. {
  428. tmp &= ~(uint32)requestMask;
  429. }
  430. baseAddr->TIMERSDEN = tmp;
  431. SchM_Exit_Mcl_MCL_EXCLUSIVE_AREA_46();
  432. }
  433. #endif
  434. #if (FLEXIO_MCL_IP_PIN_STS_IS_AVAILABLE == STD_ON)
  435. /*
  436. * This function clears the pin status flag for the specified pin.
  437. */
  438. void Flexio_Mcl_Ip_ClearPinStatus(FLEXIO_Type *baseAddr, uint8 pin)
  439. {
  440. baseAddr->PINSTAT |= (uint8)(1U << pin);
  441. }
  442. #endif
  443. #define MCL_STOP_SEC_CODE
  444. #include "Mcl_MemMap.h"
  445. #ifdef __cplusplus
  446. }
  447. #endif
  448. /** @} */