stm32h7xx_ll_hsem.h 33 KB

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