You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

902 lines
33 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx_ll_hsem.h
  4. * @author MCD Application Team
  5. * @brief Header file of HSEM LL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef STM32H7xx_LL_HSEM_H
  21. #define STM32H7xx_LL_HSEM_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "stm32h7xx.h"
  27. /** @addtogroup STM32H7xx_LL_Driver
  28. * @{
  29. */
  30. #if defined(HSEM)
  31. /** @defgroup HSEM_LL HSEM
  32. * @{
  33. */
  34. /* Private types -------------------------------------------------------------*/
  35. /* Private variables ---------------------------------------------------------*/
  36. /* Private constants ---------------------------------------------------------*/
  37. /* Private macros ------------------------------------------------------------*/
  38. /* Exported types ------------------------------------------------------------*/
  39. /* Exported constants --------------------------------------------------------*/
  40. /** @defgroup HSEM_LL_Exported_Constants HSEM Exported Constants
  41. * @{
  42. */
  43. /** @defgroup HSEM_LL_EC_COREID COREID Defines
  44. * @{
  45. */
  46. #define LL_HSEM_COREID_NONE 0U
  47. #define LL_HSEM_COREID_CPU1 HSEM_CR_COREID_CPU1
  48. #if defined(DUAL_CORE)
  49. #define LL_HSEM_COREID_CPU2 HSEM_CR_COREID_CPU2
  50. #endif /* DUAL_CORE */
  51. #define LL_HSEM_COREID HSEM_CR_COREID_CURRENT
  52. /**
  53. * @}
  54. */
  55. /** @defgroup HSEM_LL_EC_GET_FLAG Get Flags Defines
  56. * @brief Flags defines which can be used with LL_HSEM_ReadReg function
  57. * @{
  58. */
  59. #define LL_HSEM_SEMAPHORE_0 HSEM_C1IER_ISE0
  60. #define LL_HSEM_SEMAPHORE_1 HSEM_C1IER_ISE1
  61. #define LL_HSEM_SEMAPHORE_2 HSEM_C1IER_ISE2
  62. #define LL_HSEM_SEMAPHORE_3 HSEM_C1IER_ISE3
  63. #define LL_HSEM_SEMAPHORE_4 HSEM_C1IER_ISE4
  64. #define LL_HSEM_SEMAPHORE_5 HSEM_C1IER_ISE5
  65. #define LL_HSEM_SEMAPHORE_6 HSEM_C1IER_ISE6
  66. #define LL_HSEM_SEMAPHORE_7 HSEM_C1IER_ISE7
  67. #define LL_HSEM_SEMAPHORE_8 HSEM_C1IER_ISE8
  68. #define LL_HSEM_SEMAPHORE_9 HSEM_C1IER_ISE9
  69. #define LL_HSEM_SEMAPHORE_10 HSEM_C1IER_ISE10
  70. #define LL_HSEM_SEMAPHORE_11 HSEM_C1IER_ISE11
  71. #define LL_HSEM_SEMAPHORE_12 HSEM_C1IER_ISE12
  72. #define LL_HSEM_SEMAPHORE_13 HSEM_C1IER_ISE13
  73. #define LL_HSEM_SEMAPHORE_14 HSEM_C1IER_ISE14
  74. #define LL_HSEM_SEMAPHORE_15 HSEM_C1IER_ISE15
  75. #if (HSEM_SEMID_MAX == 15)
  76. #define LL_HSEM_SEMAPHORE_ALL 0x0000FFFFU
  77. #else /* HSEM_SEMID_MAX == 31 */
  78. #define LL_HSEM_SEMAPHORE_16 HSEM_C1IER_ISE16
  79. #define LL_HSEM_SEMAPHORE_17 HSEM_C1IER_ISE17
  80. #define LL_HSEM_SEMAPHORE_18 HSEM_C1IER_ISE18
  81. #define LL_HSEM_SEMAPHORE_19 HSEM_C1IER_ISE19
  82. #define LL_HSEM_SEMAPHORE_20 HSEM_C1IER_ISE20
  83. #define LL_HSEM_SEMAPHORE_21 HSEM_C1IER_ISE21
  84. #define LL_HSEM_SEMAPHORE_22 HSEM_C1IER_ISE22
  85. #define LL_HSEM_SEMAPHORE_23 HSEM_C1IER_ISE23
  86. #define LL_HSEM_SEMAPHORE_24 HSEM_C1IER_ISE24
  87. #define LL_HSEM_SEMAPHORE_25 HSEM_C1IER_ISE25
  88. #define LL_HSEM_SEMAPHORE_26 HSEM_C1IER_ISE26
  89. #define LL_HSEM_SEMAPHORE_27 HSEM_C1IER_ISE27
  90. #define LL_HSEM_SEMAPHORE_28 HSEM_C1IER_ISE28
  91. #define LL_HSEM_SEMAPHORE_29 HSEM_C1IER_ISE29
  92. #define LL_HSEM_SEMAPHORE_30 HSEM_C1IER_ISE30
  93. #define LL_HSEM_SEMAPHORE_31 HSEM_C1IER_ISE31
  94. #define LL_HSEM_SEMAPHORE_ALL 0xFFFFFFFFU
  95. #endif /* HSEM_SEMID_MAX == 15 */
  96. /**
  97. * @}
  98. */
  99. /**
  100. * @}
  101. */
  102. /* Exported macro ------------------------------------------------------------*/
  103. /** @defgroup HSEM_LL_Exported_Macros HSEM Exported Macros
  104. * @{
  105. */
  106. /** @defgroup HSEM_LL_EM_WRITE_READ Common Write and read registers Macros
  107. * @{
  108. */
  109. /**
  110. * @brief Write a value in HSEM register
  111. * @param __INSTANCE__ HSEM Instance
  112. * @param __REG__ Register to be written
  113. * @param __VALUE__ Value to be written in the register
  114. * @retval None
  115. */
  116. #define LL_HSEM_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
  117. /**
  118. * @brief Read a value in HSEM register
  119. * @param __INSTANCE__ HSEM Instance
  120. * @param __REG__ Register to be read
  121. * @retval Register value
  122. */
  123. #define LL_HSEM_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
  124. /**
  125. * @}
  126. */
  127. /**
  128. * @}
  129. */
  130. /* Exported functions --------------------------------------------------------*/
  131. /** @defgroup HSEM_LL_Exported_Functions HSEM Exported Functions
  132. * @{
  133. */
  134. /** @defgroup HSEM_LL_EF_Data_Management Data_Management
  135. * @{
  136. */
  137. /**
  138. * @brief Return 1 if the semaphore is locked, else return 0.
  139. * @rmtoll R LOCK LL_HSEM_IsSemaphoreLocked
  140. * @param HSEMx HSEM Instance.
  141. * @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
  142. * @retval State of bit (1 or 0).
  143. */
  144. __STATIC_INLINE uint32_t LL_HSEM_IsSemaphoreLocked(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
  145. {
  146. return ((READ_BIT(HSEMx->R[Semaphore], HSEM_R_LOCK) == (HSEM_R_LOCK_Msk)) ? 1UL : 0UL);
  147. }
  148. /**
  149. * @brief Get core id.
  150. * @rmtoll R COREID LL_HSEM_GetCoreId
  151. * @param HSEMx HSEM Instance.
  152. * @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
  153. * @retval Returned value can be one of the following values:
  154. * @arg @ref LL_HSEM_COREID_NONE
  155. * @arg @ref LL_HSEM_COREID_CPU1
  156. * @arg @ref LL_HSEM_COREID_CPU2
  157. */
  158. __STATIC_INLINE uint32_t LL_HSEM_GetCoreId(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
  159. {
  160. return (uint32_t)(READ_BIT(HSEMx->R[Semaphore], HSEM_R_COREID_Msk));
  161. }
  162. /**
  163. * @brief Get process id.
  164. * @rmtoll R PROCID LL_HSEM_GetProcessId
  165. * @param HSEMx HSEM Instance.
  166. * @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
  167. * @retval Process number. Value between Min_Data=0 and Max_Data=255
  168. */
  169. __STATIC_INLINE uint32_t LL_HSEM_GetProcessId(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
  170. {
  171. return (uint32_t)(READ_BIT(HSEMx->R[Semaphore], HSEM_R_PROCID_Msk));
  172. }
  173. /**
  174. * @brief Get the lock by writing in R register.
  175. * @note The R register has to be read to determined if the lock is taken.
  176. * @rmtoll R LOCK LL_HSEM_SetLock
  177. * @rmtoll R COREID LL_HSEM_SetLock
  178. * @rmtoll R PROCID LL_HSEM_SetLock
  179. * @param HSEMx HSEM Instance.
  180. * @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
  181. * @param process Process id. Value between Min_Data=0 and Max_Data=255
  182. * @retval None
  183. */
  184. __STATIC_INLINE void LL_HSEM_SetLock(HSEM_TypeDef *HSEMx, uint32_t Semaphore, uint32_t process)
  185. {
  186. WRITE_REG(HSEMx->R[Semaphore], (HSEM_R_LOCK | LL_HSEM_COREID | process));
  187. }
  188. /**
  189. * @brief Get the lock with 2-step lock.
  190. * @rmtoll R LOCK LL_HSEM_2StepLock
  191. * @rmtoll R COREID LL_HSEM_2StepLock
  192. * @rmtoll R PROCID LL_HSEM_2StepLock
  193. * @param HSEMx HSEM Instance.
  194. * @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
  195. * @param process Process id. Value between Min_Data=0 and Max_Data=255
  196. * @retval 1 lock fail, 0 lock successful or already locked by same process and core
  197. */
  198. __STATIC_INLINE uint32_t LL_HSEM_2StepLock(HSEM_TypeDef *HSEMx, uint32_t Semaphore, uint32_t process)
  199. {
  200. WRITE_REG(HSEMx->R[Semaphore], (HSEM_R_LOCK | LL_HSEM_COREID | process));
  201. return ((HSEMx->R[Semaphore] != (HSEM_R_LOCK | LL_HSEM_COREID | process)) ? 1UL : 0UL);
  202. }
  203. /**
  204. * @brief Get the lock with 1-step lock.
  205. * @rmtoll RLR LOCK LL_HSEM_1StepLock
  206. * @rmtoll RLR COREID LL_HSEM_1StepLock
  207. * @rmtoll RLR PROCID LL_HSEM_1StepLock
  208. * @param HSEMx HSEM Instance.
  209. * @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
  210. * @retval 1 lock fail, 0 lock successful or already locked by same core
  211. */
  212. __STATIC_INLINE uint32_t LL_HSEM_1StepLock(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
  213. {
  214. return ((HSEMx->RLR[Semaphore] != (HSEM_R_LOCK | LL_HSEM_COREID)) ? 1UL : 0UL);
  215. }
  216. /**
  217. * @brief Release the lock of the semaphore.
  218. * @note In case of LL_HSEM_1StepLock usage to lock a semaphore, the process is 0.
  219. * @rmtoll R LOCK LL_HSEM_ReleaseLock
  220. * @param HSEMx HSEM Instance.
  221. * @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
  222. * @param process Process number. Value between Min_Data=0 and Max_Data=255
  223. * @retval None
  224. */
  225. __STATIC_INLINE void LL_HSEM_ReleaseLock(HSEM_TypeDef *HSEMx, uint32_t Semaphore, uint32_t process)
  226. {
  227. WRITE_REG(HSEMx->R[Semaphore], (LL_HSEM_COREID | process));
  228. }
  229. /**
  230. * @brief Get the lock status of the semaphore.
  231. * @rmtoll R LOCK LL_HSEM_GetStatus
  232. * @param HSEMx HSEM Instance.
  233. * @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
  234. * @retval 0 semaphore is free, 1 semaphore is locked */
  235. __STATIC_INLINE uint32_t LL_HSEM_GetStatus(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
  236. {
  237. return ((HSEMx->R[Semaphore] != 0U) ? 1UL : 0UL);
  238. }
  239. /**
  240. * @brief Set the key.
  241. * @rmtoll KEYR KEY LL_HSEM_SetKey
  242. * @param HSEMx HSEM Instance.
  243. * @param key Key value.
  244. * @retval None
  245. */
  246. __STATIC_INLINE void LL_HSEM_SetKey(HSEM_TypeDef *HSEMx, uint32_t key)
  247. {
  248. WRITE_REG(HSEMx->KEYR, key << HSEM_KEYR_KEY_Pos);
  249. }
  250. /**
  251. * @brief Get the key.
  252. * @rmtoll KEYR KEY LL_HSEM_GetKey
  253. * @param HSEMx HSEM Instance.
  254. * @retval key to unlock all semaphore from the same core
  255. */
  256. __STATIC_INLINE uint32_t LL_HSEM_GetKey(HSEM_TypeDef *HSEMx)
  257. {
  258. return (uint32_t)(READ_BIT(HSEMx->KEYR, HSEM_KEYR_KEY) >> HSEM_KEYR_KEY_Pos);
  259. }
  260. /**
  261. * @brief Release all semaphore with the same core id.
  262. * @rmtoll CR KEY LL_HSEM_ResetAllLock
  263. * @param HSEMx HSEM Instance.
  264. * @param key Key value.
  265. * @param core This parameter can be one of the following values:
  266. * @arg @ref LL_HSEM_COREID_CPU1
  267. * @arg @ref LL_HSEM_COREID_CPU2
  268. * @retval None
  269. */
  270. __STATIC_INLINE void LL_HSEM_ResetAllLock(HSEM_TypeDef *HSEMx, uint32_t key, uint32_t core)
  271. {
  272. WRITE_REG(HSEMx->CR, (key << HSEM_CR_KEY_Pos) | core);
  273. }
  274. /**
  275. * @}
  276. */
  277. /** @defgroup HSEM_LL_EF_IT_Management IT_Management
  278. * @{
  279. */
  280. /**
  281. * @brief Enable interrupt.
  282. * @rmtoll C1IER ISEM LL_HSEM_EnableIT_C1IER
  283. * @param HSEMx HSEM Instance.
  284. * @param SemaphoreMask This parameter can be a combination of the following values:
  285. * @arg @ref LL_HSEM_SEMAPHORE_0
  286. * @arg @ref LL_HSEM_SEMAPHORE_1
  287. * @arg @ref LL_HSEM_SEMAPHORE_2
  288. * @arg @ref LL_HSEM_SEMAPHORE_3
  289. * @arg @ref LL_HSEM_SEMAPHORE_4
  290. * @arg @ref LL_HSEM_SEMAPHORE_5
  291. * @arg @ref LL_HSEM_SEMAPHORE_6
  292. * @arg @ref LL_HSEM_SEMAPHORE_7
  293. * @arg @ref LL_HSEM_SEMAPHORE_8
  294. * @arg @ref LL_HSEM_SEMAPHORE_9
  295. * @arg @ref LL_HSEM_SEMAPHORE_10
  296. * @arg @ref LL_HSEM_SEMAPHORE_11
  297. * @arg @ref LL_HSEM_SEMAPHORE_12
  298. * @arg @ref LL_HSEM_SEMAPHORE_13
  299. * @arg @ref LL_HSEM_SEMAPHORE_14
  300. * @arg @ref LL_HSEM_SEMAPHORE_15
  301. * @arg @ref LL_HSEM_SEMAPHORE_16
  302. * @arg @ref LL_HSEM_SEMAPHORE_17
  303. * @arg @ref LL_HSEM_SEMAPHORE_18
  304. * @arg @ref LL_HSEM_SEMAPHORE_19
  305. * @arg @ref LL_HSEM_SEMAPHORE_20
  306. * @arg @ref LL_HSEM_SEMAPHORE_21
  307. * @arg @ref LL_HSEM_SEMAPHORE_22
  308. * @arg @ref LL_HSEM_SEMAPHORE_23
  309. * @arg @ref LL_HSEM_SEMAPHORE_24
  310. * @arg @ref LL_HSEM_SEMAPHORE_25
  311. * @arg @ref LL_HSEM_SEMAPHORE_26
  312. * @arg @ref LL_HSEM_SEMAPHORE_27
  313. * @arg @ref LL_HSEM_SEMAPHORE_28
  314. * @arg @ref LL_HSEM_SEMAPHORE_29
  315. * @arg @ref LL_HSEM_SEMAPHORE_30
  316. * @arg @ref LL_HSEM_SEMAPHORE_31
  317. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  318. * @note Availability of flags LL_HSEM_SEMAPHORE_16 to LL_HSEM_SEMAPHORE_31
  319. * depends on devices.
  320. * @retval None
  321. */
  322. __STATIC_INLINE void LL_HSEM_EnableIT_C1IER(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  323. {
  324. SET_BIT(HSEMx->C1IER, SemaphoreMask);
  325. }
  326. /**
  327. * @brief Disable interrupt.
  328. * @rmtoll C1IER ISEM LL_HSEM_DisableIT_C1IER
  329. * @param HSEMx HSEM Instance.
  330. * @param SemaphoreMask This parameter can be a combination of the following values:
  331. * @arg @ref LL_HSEM_SEMAPHORE_0
  332. * @arg @ref LL_HSEM_SEMAPHORE_1
  333. * @arg @ref LL_HSEM_SEMAPHORE_2
  334. * @arg @ref LL_HSEM_SEMAPHORE_3
  335. * @arg @ref LL_HSEM_SEMAPHORE_4
  336. * @arg @ref LL_HSEM_SEMAPHORE_5
  337. * @arg @ref LL_HSEM_SEMAPHORE_6
  338. * @arg @ref LL_HSEM_SEMAPHORE_7
  339. * @arg @ref LL_HSEM_SEMAPHORE_8
  340. * @arg @ref LL_HSEM_SEMAPHORE_9
  341. * @arg @ref LL_HSEM_SEMAPHORE_10
  342. * @arg @ref LL_HSEM_SEMAPHORE_11
  343. * @arg @ref LL_HSEM_SEMAPHORE_12
  344. * @arg @ref LL_HSEM_SEMAPHORE_13
  345. * @arg @ref LL_HSEM_SEMAPHORE_14
  346. * @arg @ref LL_HSEM_SEMAPHORE_15
  347. * @arg @ref LL_HSEM_SEMAPHORE_16
  348. * @arg @ref LL_HSEM_SEMAPHORE_17
  349. * @arg @ref LL_HSEM_SEMAPHORE_18
  350. * @arg @ref LL_HSEM_SEMAPHORE_19
  351. * @arg @ref LL_HSEM_SEMAPHORE_20
  352. * @arg @ref LL_HSEM_SEMAPHORE_21
  353. * @arg @ref LL_HSEM_SEMAPHORE_22
  354. * @arg @ref LL_HSEM_SEMAPHORE_23
  355. * @arg @ref LL_HSEM_SEMAPHORE_24
  356. * @arg @ref LL_HSEM_SEMAPHORE_25
  357. * @arg @ref LL_HSEM_SEMAPHORE_26
  358. * @arg @ref LL_HSEM_SEMAPHORE_27
  359. * @arg @ref LL_HSEM_SEMAPHORE_28
  360. * @arg @ref LL_HSEM_SEMAPHORE_29
  361. * @arg @ref LL_HSEM_SEMAPHORE_30
  362. * @arg @ref LL_HSEM_SEMAPHORE_31
  363. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  364. * @note Availability of flags LL_HSEM_SEMAPHORE_16 to LL_HSEM_SEMAPHORE_31
  365. * depends on devices.
  366. * @retval None
  367. */
  368. __STATIC_INLINE void LL_HSEM_DisableIT_C1IER(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  369. {
  370. CLEAR_BIT(HSEMx->C1IER, SemaphoreMask);
  371. }
  372. /**
  373. * @brief Check if interrupt is enabled.
  374. * @rmtoll C1IER ISEM LL_HSEM_IsEnabledIT_C1IER
  375. * @param HSEMx HSEM Instance.
  376. * @param SemaphoreMask This parameter can be a combination of the following values:
  377. * @arg @ref LL_HSEM_SEMAPHORE_0
  378. * @arg @ref LL_HSEM_SEMAPHORE_1
  379. * @arg @ref LL_HSEM_SEMAPHORE_2
  380. * @arg @ref LL_HSEM_SEMAPHORE_3
  381. * @arg @ref LL_HSEM_SEMAPHORE_4
  382. * @arg @ref LL_HSEM_SEMAPHORE_5
  383. * @arg @ref LL_HSEM_SEMAPHORE_6
  384. * @arg @ref LL_HSEM_SEMAPHORE_7
  385. * @arg @ref LL_HSEM_SEMAPHORE_8
  386. * @arg @ref LL_HSEM_SEMAPHORE_9
  387. * @arg @ref LL_HSEM_SEMAPHORE_10
  388. * @arg @ref LL_HSEM_SEMAPHORE_11
  389. * @arg @ref LL_HSEM_SEMAPHORE_12
  390. * @arg @ref LL_HSEM_SEMAPHORE_13
  391. * @arg @ref LL_HSEM_SEMAPHORE_14
  392. * @arg @ref LL_HSEM_SEMAPHORE_15
  393. * @arg @ref LL_HSEM_SEMAPHORE_16
  394. * @arg @ref LL_HSEM_SEMAPHORE_17
  395. * @arg @ref LL_HSEM_SEMAPHORE_18
  396. * @arg @ref LL_HSEM_SEMAPHORE_19
  397. * @arg @ref LL_HSEM_SEMAPHORE_20
  398. * @arg @ref LL_HSEM_SEMAPHORE_21
  399. * @arg @ref LL_HSEM_SEMAPHORE_22
  400. * @arg @ref LL_HSEM_SEMAPHORE_23
  401. * @arg @ref LL_HSEM_SEMAPHORE_24
  402. * @arg @ref LL_HSEM_SEMAPHORE_25
  403. * @arg @ref LL_HSEM_SEMAPHORE_26
  404. * @arg @ref LL_HSEM_SEMAPHORE_27
  405. * @arg @ref LL_HSEM_SEMAPHORE_28
  406. * @arg @ref LL_HSEM_SEMAPHORE_29
  407. * @arg @ref LL_HSEM_SEMAPHORE_30
  408. * @arg @ref LL_HSEM_SEMAPHORE_31
  409. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  410. * @note Availability of flags LL_HSEM_SEMAPHORE_16 to LL_HSEM_SEMAPHORE_31
  411. * depends on devices.
  412. * @retval State of bit (1 or 0).
  413. */
  414. __STATIC_INLINE uint32_t LL_HSEM_IsEnabledIT_C1IER(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  415. {
  416. return ((READ_BIT(HSEMx->C1IER, SemaphoreMask) == (SemaphoreMask)) ? 1UL : 0UL);
  417. }
  418. #if defined(DUAL_CORE)
  419. /**
  420. * @brief Enable interrupt.
  421. * @rmtoll C2IER ISEM LL_HSEM_EnableIT_C2IER
  422. * @param HSEMx HSEM Instance.
  423. * @param SemaphoreMask This parameter can be a combination of the following values:
  424. * @arg @ref LL_HSEM_SEMAPHORE_0
  425. * @arg @ref LL_HSEM_SEMAPHORE_1
  426. * @arg @ref LL_HSEM_SEMAPHORE_2
  427. * @arg @ref LL_HSEM_SEMAPHORE_3
  428. * @arg @ref LL_HSEM_SEMAPHORE_4
  429. * @arg @ref LL_HSEM_SEMAPHORE_5
  430. * @arg @ref LL_HSEM_SEMAPHORE_6
  431. * @arg @ref LL_HSEM_SEMAPHORE_7
  432. * @arg @ref LL_HSEM_SEMAPHORE_8
  433. * @arg @ref LL_HSEM_SEMAPHORE_9
  434. * @arg @ref LL_HSEM_SEMAPHORE_10
  435. * @arg @ref LL_HSEM_SEMAPHORE_11
  436. * @arg @ref LL_HSEM_SEMAPHORE_12
  437. * @arg @ref LL_HSEM_SEMAPHORE_13
  438. * @arg @ref LL_HSEM_SEMAPHORE_14
  439. * @arg @ref LL_HSEM_SEMAPHORE_15
  440. * @arg @ref LL_HSEM_SEMAPHORE_16
  441. * @arg @ref LL_HSEM_SEMAPHORE_17
  442. * @arg @ref LL_HSEM_SEMAPHORE_18
  443. * @arg @ref LL_HSEM_SEMAPHORE_19
  444. * @arg @ref LL_HSEM_SEMAPHORE_20
  445. * @arg @ref LL_HSEM_SEMAPHORE_21
  446. * @arg @ref LL_HSEM_SEMAPHORE_22
  447. * @arg @ref LL_HSEM_SEMAPHORE_23
  448. * @arg @ref LL_HSEM_SEMAPHORE_24
  449. * @arg @ref LL_HSEM_SEMAPHORE_25
  450. * @arg @ref LL_HSEM_SEMAPHORE_26
  451. * @arg @ref LL_HSEM_SEMAPHORE_27
  452. * @arg @ref LL_HSEM_SEMAPHORE_28
  453. * @arg @ref LL_HSEM_SEMAPHORE_29
  454. * @arg @ref LL_HSEM_SEMAPHORE_30
  455. * @arg @ref LL_HSEM_SEMAPHORE_31
  456. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  457. * @retval None
  458. */
  459. __STATIC_INLINE void LL_HSEM_EnableIT_C2IER(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  460. {
  461. SET_BIT(HSEMx->C2IER, SemaphoreMask);
  462. }
  463. /**
  464. * @brief Disable interrupt.
  465. * @rmtoll C2IER ISEM LL_HSEM_DisableIT_C2IER
  466. * @param HSEMx HSEM Instance.
  467. * @param SemaphoreMask This parameter can be a combination of the following values:
  468. * @arg @ref LL_HSEM_SEMAPHORE_0
  469. * @arg @ref LL_HSEM_SEMAPHORE_1
  470. * @arg @ref LL_HSEM_SEMAPHORE_2
  471. * @arg @ref LL_HSEM_SEMAPHORE_3
  472. * @arg @ref LL_HSEM_SEMAPHORE_4
  473. * @arg @ref LL_HSEM_SEMAPHORE_5
  474. * @arg @ref LL_HSEM_SEMAPHORE_6
  475. * @arg @ref LL_HSEM_SEMAPHORE_7
  476. * @arg @ref LL_HSEM_SEMAPHORE_8
  477. * @arg @ref LL_HSEM_SEMAPHORE_9
  478. * @arg @ref LL_HSEM_SEMAPHORE_10
  479. * @arg @ref LL_HSEM_SEMAPHORE_11
  480. * @arg @ref LL_HSEM_SEMAPHORE_12
  481. * @arg @ref LL_HSEM_SEMAPHORE_13
  482. * @arg @ref LL_HSEM_SEMAPHORE_14
  483. * @arg @ref LL_HSEM_SEMAPHORE_15
  484. * @arg @ref LL_HSEM_SEMAPHORE_16
  485. * @arg @ref LL_HSEM_SEMAPHORE_17
  486. * @arg @ref LL_HSEM_SEMAPHORE_18
  487. * @arg @ref LL_HSEM_SEMAPHORE_19
  488. * @arg @ref LL_HSEM_SEMAPHORE_20
  489. * @arg @ref LL_HSEM_SEMAPHORE_21
  490. * @arg @ref LL_HSEM_SEMAPHORE_22
  491. * @arg @ref LL_HSEM_SEMAPHORE_23
  492. * @arg @ref LL_HSEM_SEMAPHORE_24
  493. * @arg @ref LL_HSEM_SEMAPHORE_25
  494. * @arg @ref LL_HSEM_SEMAPHORE_26
  495. * @arg @ref LL_HSEM_SEMAPHORE_27
  496. * @arg @ref LL_HSEM_SEMAPHORE_28
  497. * @arg @ref LL_HSEM_SEMAPHORE_29
  498. * @arg @ref LL_HSEM_SEMAPHORE_30
  499. * @arg @ref LL_HSEM_SEMAPHORE_31
  500. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  501. * @retval None
  502. */
  503. __STATIC_INLINE void LL_HSEM_DisableIT_C2IER(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  504. {
  505. CLEAR_BIT(HSEMx->C2IER, SemaphoreMask);
  506. }
  507. /**
  508. * @brief Check if interrupt is enabled.
  509. * @rmtoll C2IER ISEM LL_HSEM_IsEnabledIT_C2IER
  510. * @param HSEMx HSEM Instance.
  511. * @param SemaphoreMask This parameter can be a combination of the following values:
  512. * @arg @ref LL_HSEM_SEMAPHORE_0
  513. * @arg @ref LL_HSEM_SEMAPHORE_1
  514. * @arg @ref LL_HSEM_SEMAPHORE_2
  515. * @arg @ref LL_HSEM_SEMAPHORE_3
  516. * @arg @ref LL_HSEM_SEMAPHORE_4
  517. * @arg @ref LL_HSEM_SEMAPHORE_5
  518. * @arg @ref LL_HSEM_SEMAPHORE_6
  519. * @arg @ref LL_HSEM_SEMAPHORE_7
  520. * @arg @ref LL_HSEM_SEMAPHORE_8
  521. * @arg @ref LL_HSEM_SEMAPHORE_9
  522. * @arg @ref LL_HSEM_SEMAPHORE_10
  523. * @arg @ref LL_HSEM_SEMAPHORE_11
  524. * @arg @ref LL_HSEM_SEMAPHORE_12
  525. * @arg @ref LL_HSEM_SEMAPHORE_13
  526. * @arg @ref LL_HSEM_SEMAPHORE_14
  527. * @arg @ref LL_HSEM_SEMAPHORE_15
  528. * @arg @ref LL_HSEM_SEMAPHORE_16
  529. * @arg @ref LL_HSEM_SEMAPHORE_17
  530. * @arg @ref LL_HSEM_SEMAPHORE_18
  531. * @arg @ref LL_HSEM_SEMAPHORE_19
  532. * @arg @ref LL_HSEM_SEMAPHORE_20
  533. * @arg @ref LL_HSEM_SEMAPHORE_21
  534. * @arg @ref LL_HSEM_SEMAPHORE_22
  535. * @arg @ref LL_HSEM_SEMAPHORE_23
  536. * @arg @ref LL_HSEM_SEMAPHORE_24
  537. * @arg @ref LL_HSEM_SEMAPHORE_25
  538. * @arg @ref LL_HSEM_SEMAPHORE_26
  539. * @arg @ref LL_HSEM_SEMAPHORE_27
  540. * @arg @ref LL_HSEM_SEMAPHORE_28
  541. * @arg @ref LL_HSEM_SEMAPHORE_29
  542. * @arg @ref LL_HSEM_SEMAPHORE_30
  543. * @arg @ref LL_HSEM_SEMAPHORE_31
  544. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  545. * @retval State of bit (1 or 0).
  546. */
  547. __STATIC_INLINE uint32_t LL_HSEM_IsEnabledIT_C2IER(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  548. {
  549. return ((READ_BIT(HSEMx->C2IER, SemaphoreMask) == (SemaphoreMask)) ? 1UL : 0UL);
  550. }
  551. #endif /* DUAL_CORE */
  552. /**
  553. * @}
  554. */
  555. /** @defgroup HSEM_LL_EF_FLAG_Management FLAG_Management
  556. * @{
  557. */
  558. /**
  559. * @brief Clear interrupt status.
  560. * @rmtoll C1ICR ISEM LL_HSEM_ClearFlag_C1ICR
  561. * @param HSEMx HSEM Instance.
  562. * @param SemaphoreMask This parameter can be a combination of the following values:
  563. * @arg @ref LL_HSEM_SEMAPHORE_0
  564. * @arg @ref LL_HSEM_SEMAPHORE_1
  565. * @arg @ref LL_HSEM_SEMAPHORE_2
  566. * @arg @ref LL_HSEM_SEMAPHORE_3
  567. * @arg @ref LL_HSEM_SEMAPHORE_4
  568. * @arg @ref LL_HSEM_SEMAPHORE_5
  569. * @arg @ref LL_HSEM_SEMAPHORE_6
  570. * @arg @ref LL_HSEM_SEMAPHORE_7
  571. * @arg @ref LL_HSEM_SEMAPHORE_8
  572. * @arg @ref LL_HSEM_SEMAPHORE_9
  573. * @arg @ref LL_HSEM_SEMAPHORE_10
  574. * @arg @ref LL_HSEM_SEMAPHORE_11
  575. * @arg @ref LL_HSEM_SEMAPHORE_12
  576. * @arg @ref LL_HSEM_SEMAPHORE_13
  577. * @arg @ref LL_HSEM_SEMAPHORE_14
  578. * @arg @ref LL_HSEM_SEMAPHORE_15
  579. * @arg @ref LL_HSEM_SEMAPHORE_16
  580. * @arg @ref LL_HSEM_SEMAPHORE_17
  581. * @arg @ref LL_HSEM_SEMAPHORE_18
  582. * @arg @ref LL_HSEM_SEMAPHORE_19
  583. * @arg @ref LL_HSEM_SEMAPHORE_20
  584. * @arg @ref LL_HSEM_SEMAPHORE_21
  585. * @arg @ref LL_HSEM_SEMAPHORE_22
  586. * @arg @ref LL_HSEM_SEMAPHORE_23
  587. * @arg @ref LL_HSEM_SEMAPHORE_24
  588. * @arg @ref LL_HSEM_SEMAPHORE_25
  589. * @arg @ref LL_HSEM_SEMAPHORE_26
  590. * @arg @ref LL_HSEM_SEMAPHORE_27
  591. * @arg @ref LL_HSEM_SEMAPHORE_28
  592. * @arg @ref LL_HSEM_SEMAPHORE_29
  593. * @arg @ref LL_HSEM_SEMAPHORE_30
  594. * @arg @ref LL_HSEM_SEMAPHORE_31
  595. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  596. * @note Availability of flags LL_HSEM_SEMAPHORE_16 to LL_HSEM_SEMAPHORE_31
  597. * depends on devices.
  598. * @retval None
  599. */
  600. __STATIC_INLINE void LL_HSEM_ClearFlag_C1ICR(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  601. {
  602. WRITE_REG(HSEMx->C1ICR, SemaphoreMask);
  603. }
  604. /**
  605. * @brief Get interrupt status from ISR register.
  606. * @rmtoll C1ISR ISEM LL_HSEM_IsActiveFlag_C1ISR
  607. * @param HSEMx HSEM Instance.
  608. * @param SemaphoreMask This parameter can be a combination of the following values:
  609. * @arg @ref LL_HSEM_SEMAPHORE_0
  610. * @arg @ref LL_HSEM_SEMAPHORE_1
  611. * @arg @ref LL_HSEM_SEMAPHORE_2
  612. * @arg @ref LL_HSEM_SEMAPHORE_3
  613. * @arg @ref LL_HSEM_SEMAPHORE_4
  614. * @arg @ref LL_HSEM_SEMAPHORE_5
  615. * @arg @ref LL_HSEM_SEMAPHORE_6
  616. * @arg @ref LL_HSEM_SEMAPHORE_7
  617. * @arg @ref LL_HSEM_SEMAPHORE_8
  618. * @arg @ref LL_HSEM_SEMAPHORE_9
  619. * @arg @ref LL_HSEM_SEMAPHORE_10
  620. * @arg @ref LL_HSEM_SEMAPHORE_11
  621. * @arg @ref LL_HSEM_SEMAPHORE_12
  622. * @arg @ref LL_HSEM_SEMAPHORE_13
  623. * @arg @ref LL_HSEM_SEMAPHORE_14
  624. * @arg @ref LL_HSEM_SEMAPHORE_15
  625. * @arg @ref LL_HSEM_SEMAPHORE_16
  626. * @arg @ref LL_HSEM_SEMAPHORE_17
  627. * @arg @ref LL_HSEM_SEMAPHORE_18
  628. * @arg @ref LL_HSEM_SEMAPHORE_19
  629. * @arg @ref LL_HSEM_SEMAPHORE_20
  630. * @arg @ref LL_HSEM_SEMAPHORE_21
  631. * @arg @ref LL_HSEM_SEMAPHORE_22
  632. * @arg @ref LL_HSEM_SEMAPHORE_23
  633. * @arg @ref LL_HSEM_SEMAPHORE_24
  634. * @arg @ref LL_HSEM_SEMAPHORE_25
  635. * @arg @ref LL_HSEM_SEMAPHORE_26
  636. * @arg @ref LL_HSEM_SEMAPHORE_27
  637. * @arg @ref LL_HSEM_SEMAPHORE_28
  638. * @arg @ref LL_HSEM_SEMAPHORE_29
  639. * @arg @ref LL_HSEM_SEMAPHORE_30
  640. * @arg @ref LL_HSEM_SEMAPHORE_31
  641. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  642. * @note Availability of flags LL_HSEM_SEMAPHORE_16 to LL_HSEM_SEMAPHORE_31
  643. * depends on devices.
  644. * @retval State of bit (1 or 0).
  645. */
  646. __STATIC_INLINE uint32_t LL_HSEM_IsActiveFlag_C1ISR(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  647. {
  648. return ((READ_BIT(HSEMx->C1ISR, SemaphoreMask) == (SemaphoreMask)) ? 1UL : 0UL);
  649. }
  650. /**
  651. * @brief Get interrupt status from MISR register.
  652. * @rmtoll C1MISR ISEM LL_HSEM_IsActiveFlag_C1MISR
  653. * @param HSEMx HSEM Instance.
  654. * @param SemaphoreMask This parameter can be a combination of the following values:
  655. * @arg @ref LL_HSEM_SEMAPHORE_0
  656. * @arg @ref LL_HSEM_SEMAPHORE_1
  657. * @arg @ref LL_HSEM_SEMAPHORE_2
  658. * @arg @ref LL_HSEM_SEMAPHORE_3
  659. * @arg @ref LL_HSEM_SEMAPHORE_4
  660. * @arg @ref LL_HSEM_SEMAPHORE_5
  661. * @arg @ref LL_HSEM_SEMAPHORE_6
  662. * @arg @ref LL_HSEM_SEMAPHORE_7
  663. * @arg @ref LL_HSEM_SEMAPHORE_8
  664. * @arg @ref LL_HSEM_SEMAPHORE_9
  665. * @arg @ref LL_HSEM_SEMAPHORE_10
  666. * @arg @ref LL_HSEM_SEMAPHORE_11
  667. * @arg @ref LL_HSEM_SEMAPHORE_12
  668. * @arg @ref LL_HSEM_SEMAPHORE_13
  669. * @arg @ref LL_HSEM_SEMAPHORE_14
  670. * @arg @ref LL_HSEM_SEMAPHORE_15
  671. * @arg @ref LL_HSEM_SEMAPHORE_16
  672. * @arg @ref LL_HSEM_SEMAPHORE_17
  673. * @arg @ref LL_HSEM_SEMAPHORE_18
  674. * @arg @ref LL_HSEM_SEMAPHORE_19
  675. * @arg @ref LL_HSEM_SEMAPHORE_20
  676. * @arg @ref LL_HSEM_SEMAPHORE_21
  677. * @arg @ref LL_HSEM_SEMAPHORE_22
  678. * @arg @ref LL_HSEM_SEMAPHORE_23
  679. * @arg @ref LL_HSEM_SEMAPHORE_24
  680. * @arg @ref LL_HSEM_SEMAPHORE_25
  681. * @arg @ref LL_HSEM_SEMAPHORE_26
  682. * @arg @ref LL_HSEM_SEMAPHORE_27
  683. * @arg @ref LL_HSEM_SEMAPHORE_28
  684. * @arg @ref LL_HSEM_SEMAPHORE_29
  685. * @arg @ref LL_HSEM_SEMAPHORE_30
  686. * @arg @ref LL_HSEM_SEMAPHORE_31
  687. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  688. * @note Availability of flags LL_HSEM_SEMAPHORE_16 to LL_HSEM_SEMAPHORE_31
  689. * depends on devices.
  690. * @retval State of bit (1 or 0).
  691. */
  692. __STATIC_INLINE uint32_t LL_HSEM_IsActiveFlag_C1MISR(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  693. {
  694. return ((READ_BIT(HSEMx->C1MISR, SemaphoreMask) == (SemaphoreMask)) ? 1UL : 0UL);
  695. }
  696. #if defined(DUAL_CORE)
  697. /**
  698. * @brief Clear interrupt status.
  699. * @rmtoll C2ICR ISEM LL_HSEM_ClearFlag_C2ICR
  700. * @param HSEMx HSEM Instance.
  701. * @param SemaphoreMask This parameter can be a combination of the following values:
  702. * @arg @ref LL_HSEM_SEMAPHORE_0
  703. * @arg @ref LL_HSEM_SEMAPHORE_1
  704. * @arg @ref LL_HSEM_SEMAPHORE_2
  705. * @arg @ref LL_HSEM_SEMAPHORE_3
  706. * @arg @ref LL_HSEM_SEMAPHORE_4
  707. * @arg @ref LL_HSEM_SEMAPHORE_5
  708. * @arg @ref LL_HSEM_SEMAPHORE_6
  709. * @arg @ref LL_HSEM_SEMAPHORE_7
  710. * @arg @ref LL_HSEM_SEMAPHORE_8
  711. * @arg @ref LL_HSEM_SEMAPHORE_9
  712. * @arg @ref LL_HSEM_SEMAPHORE_10
  713. * @arg @ref LL_HSEM_SEMAPHORE_11
  714. * @arg @ref LL_HSEM_SEMAPHORE_12
  715. * @arg @ref LL_HSEM_SEMAPHORE_13
  716. * @arg @ref LL_HSEM_SEMAPHORE_14
  717. * @arg @ref LL_HSEM_SEMAPHORE_15
  718. * @arg @ref LL_HSEM_SEMAPHORE_16
  719. * @arg @ref LL_HSEM_SEMAPHORE_17
  720. * @arg @ref LL_HSEM_SEMAPHORE_18
  721. * @arg @ref LL_HSEM_SEMAPHORE_19
  722. * @arg @ref LL_HSEM_SEMAPHORE_20
  723. * @arg @ref LL_HSEM_SEMAPHORE_21
  724. * @arg @ref LL_HSEM_SEMAPHORE_22
  725. * @arg @ref LL_HSEM_SEMAPHORE_23
  726. * @arg @ref LL_HSEM_SEMAPHORE_24
  727. * @arg @ref LL_HSEM_SEMAPHORE_25
  728. * @arg @ref LL_HSEM_SEMAPHORE_26
  729. * @arg @ref LL_HSEM_SEMAPHORE_27
  730. * @arg @ref LL_HSEM_SEMAPHORE_28
  731. * @arg @ref LL_HSEM_SEMAPHORE_29
  732. * @arg @ref LL_HSEM_SEMAPHORE_30
  733. * @arg @ref LL_HSEM_SEMAPHORE_31
  734. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  735. * @retval None
  736. */
  737. __STATIC_INLINE void LL_HSEM_ClearFlag_C2ICR(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  738. {
  739. WRITE_REG(HSEMx->C2ICR, SemaphoreMask);
  740. }
  741. /**
  742. * @brief Get interrupt status from ISR register.
  743. * @rmtoll C2ISR ISEM LL_HSEM_IsActiveFlag_C2ISR
  744. * @param HSEMx HSEM Instance.
  745. * @param SemaphoreMask This parameter can be a combination of the following values:
  746. * @arg @ref LL_HSEM_SEMAPHORE_0
  747. * @arg @ref LL_HSEM_SEMAPHORE_1
  748. * @arg @ref LL_HSEM_SEMAPHORE_2
  749. * @arg @ref LL_HSEM_SEMAPHORE_3
  750. * @arg @ref LL_HSEM_SEMAPHORE_4
  751. * @arg @ref LL_HSEM_SEMAPHORE_5
  752. * @arg @ref LL_HSEM_SEMAPHORE_6
  753. * @arg @ref LL_HSEM_SEMAPHORE_7
  754. * @arg @ref LL_HSEM_SEMAPHORE_8
  755. * @arg @ref LL_HSEM_SEMAPHORE_9
  756. * @arg @ref LL_HSEM_SEMAPHORE_10
  757. * @arg @ref LL_HSEM_SEMAPHORE_11
  758. * @arg @ref LL_HSEM_SEMAPHORE_12
  759. * @arg @ref LL_HSEM_SEMAPHORE_13
  760. * @arg @ref LL_HSEM_SEMAPHORE_14
  761. * @arg @ref LL_HSEM_SEMAPHORE_15
  762. * @arg @ref LL_HSEM_SEMAPHORE_16
  763. * @arg @ref LL_HSEM_SEMAPHORE_17
  764. * @arg @ref LL_HSEM_SEMAPHORE_18
  765. * @arg @ref LL_HSEM_SEMAPHORE_19
  766. * @arg @ref LL_HSEM_SEMAPHORE_20
  767. * @arg @ref LL_HSEM_SEMAPHORE_21
  768. * @arg @ref LL_HSEM_SEMAPHORE_22
  769. * @arg @ref LL_HSEM_SEMAPHORE_23
  770. * @arg @ref LL_HSEM_SEMAPHORE_24
  771. * @arg @ref LL_HSEM_SEMAPHORE_25
  772. * @arg @ref LL_HSEM_SEMAPHORE_26
  773. * @arg @ref LL_HSEM_SEMAPHORE_27
  774. * @arg @ref LL_HSEM_SEMAPHORE_28
  775. * @arg @ref LL_HSEM_SEMAPHORE_29
  776. * @arg @ref LL_HSEM_SEMAPHORE_30
  777. * @arg @ref LL_HSEM_SEMAPHORE_31
  778. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  779. * @retval State of bit (1 or 0).
  780. */
  781. __STATIC_INLINE uint32_t LL_HSEM_IsActiveFlag_C2ISR(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  782. {
  783. return ((READ_BIT(HSEMx->C2ISR, SemaphoreMask) == (SemaphoreMask)) ? 1UL : 0UL);
  784. }
  785. /**
  786. * @brief Get interrupt status from MISR register.
  787. * @rmtoll C2MISR ISEM LL_HSEM_IsActiveFlag_C2MISR
  788. * @param HSEMx HSEM Instance.
  789. * @param SemaphoreMask This parameter can be a combination of the following values:
  790. * @arg @ref LL_HSEM_SEMAPHORE_0
  791. * @arg @ref LL_HSEM_SEMAPHORE_1
  792. * @arg @ref LL_HSEM_SEMAPHORE_2
  793. * @arg @ref LL_HSEM_SEMAPHORE_3
  794. * @arg @ref LL_HSEM_SEMAPHORE_4
  795. * @arg @ref LL_HSEM_SEMAPHORE_5
  796. * @arg @ref LL_HSEM_SEMAPHORE_6
  797. * @arg @ref LL_HSEM_SEMAPHORE_7
  798. * @arg @ref LL_HSEM_SEMAPHORE_8
  799. * @arg @ref LL_HSEM_SEMAPHORE_9
  800. * @arg @ref LL_HSEM_SEMAPHORE_10
  801. * @arg @ref LL_HSEM_SEMAPHORE_11
  802. * @arg @ref LL_HSEM_SEMAPHORE_12
  803. * @arg @ref LL_HSEM_SEMAPHORE_13
  804. * @arg @ref LL_HSEM_SEMAPHORE_14
  805. * @arg @ref LL_HSEM_SEMAPHORE_15
  806. * @arg @ref LL_HSEM_SEMAPHORE_16
  807. * @arg @ref LL_HSEM_SEMAPHORE_17
  808. * @arg @ref LL_HSEM_SEMAPHORE_18
  809. * @arg @ref LL_HSEM_SEMAPHORE_19
  810. * @arg @ref LL_HSEM_SEMAPHORE_20
  811. * @arg @ref LL_HSEM_SEMAPHORE_21
  812. * @arg @ref LL_HSEM_SEMAPHORE_22
  813. * @arg @ref LL_HSEM_SEMAPHORE_23
  814. * @arg @ref LL_HSEM_SEMAPHORE_24
  815. * @arg @ref LL_HSEM_SEMAPHORE_25
  816. * @arg @ref LL_HSEM_SEMAPHORE_26
  817. * @arg @ref LL_HSEM_SEMAPHORE_27
  818. * @arg @ref LL_HSEM_SEMAPHORE_28
  819. * @arg @ref LL_HSEM_SEMAPHORE_29
  820. * @arg @ref LL_HSEM_SEMAPHORE_30
  821. * @arg @ref LL_HSEM_SEMAPHORE_31
  822. * @arg @ref LL_HSEM_SEMAPHORE_ALL
  823. * @retval State of bit (1 or 0).
  824. */
  825. __STATIC_INLINE uint32_t LL_HSEM_IsActiveFlag_C2MISR(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
  826. {
  827. return ((READ_BIT(HSEMx->C2MISR, SemaphoreMask) == (SemaphoreMask)) ? 1UL : 0UL);
  828. }
  829. #endif /* DUAL_CORE */
  830. /**
  831. * @}
  832. */
  833. /**
  834. * @}
  835. */
  836. /**
  837. * @}
  838. */
  839. #endif /* defined(HSEM) */
  840. /**
  841. * @}
  842. */
  843. #ifdef __cplusplus
  844. }
  845. #endif
  846. #endif /* __STM32H7xx_LL_HSEM_H */
  847. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/