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.
 
 
 

881 lines
32 KiB

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