py32f002b_ll_bus.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. /**
  2. ******************************************************************************
  3. * @file py32f002b_ll_bus.h
  4. * @author MCU Application Team
  5. * @brief Header file of BUS LL module.
  6. @verbatim
  7. ##### RCC Limitations #####
  8. ==============================================================================
  9. [..]
  10. A delay between an RCC peripheral clock enable and the effective peripheral
  11. enabling should be taken into account in order to manage the peripheral read/write
  12. from/to registers.
  13. (+) This delay depends on the peripheral mapping.
  14. (++) AHB & APB1 peripherals, 1 dummy read is necessary
  15. [..]
  16. Workarounds:
  17. (#) For AHB & APB1 peripherals, a dummy read to the peripheral register has been
  18. inserted in each LL_{BUS}_GRP{x}_EnableClock() function.
  19. @endverbatim
  20. ******************************************************************************
  21. * @attention
  22. *
  23. * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co.
  24. * All rights reserved.</center></h2>
  25. *
  26. * This software component is licensed by Puya under BSD 3-Clause license,
  27. * the "License"; You may not use this file except in compliance with the
  28. * License. You may obtain a copy of the License at:
  29. * opensource.org/licenses/BSD-3-Clause
  30. *
  31. ******************************************************************************
  32. * @attention
  33. *
  34. * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
  35. * All rights reserved.</center></h2>
  36. *
  37. * This software component is licensed by ST under BSD 3-Clause license,
  38. * the "License"; You may not use this file except in compliance with the
  39. * License. You may obtain a copy of the License at:
  40. * opensource.org/licenses/BSD-3-Clause
  41. *
  42. ******************************************************************************
  43. */
  44. /* Define to prevent recursive inclusion -------------------------------------*/
  45. #ifndef __PY32F002B_LL_BUS_H
  46. #define __PY32F002B_LL_BUS_H
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50. /* Includes ------------------------------------------------------------------*/
  51. #include "py32f0xx.h"
  52. /** @addtogroup PY32F002B_LL_Driver
  53. * @{
  54. */
  55. #if defined(RCC)
  56. /** @defgroup BUS_LL BUS
  57. * @{
  58. */
  59. /* Private types -------------------------------------------------------------*/
  60. /* Private variables ---------------------------------------------------------*/
  61. /* Private constants ---------------------------------------------------------*/
  62. /* Private macros ------------------------------------------------------------*/
  63. /* Exported types ------------------------------------------------------------*/
  64. /* Exported constants --------------------------------------------------------*/
  65. /** @defgroup BUS_LL_Exported_Constants BUS Exported Constants
  66. * @{
  67. */
  68. /** @defgroup BUS_LL_EC_AHB1_GRP1_PERIPH AHB1 GRP1 PERIPH
  69. * @{
  70. */
  71. #define LL_AHB1_GRP1_PERIPH_ALL 0xFFFFFFFFU
  72. #define LL_AHB1_GRP1_PERIPH_FLASH RCC_AHBENR_FLASHEN
  73. #define LL_AHB1_GRP1_PERIPH_SRAM RCC_AHBENR_SRAMEN
  74. #define LL_AHB1_GRP1_PERIPH_CRC RCC_AHBENR_CRCEN
  75. /**
  76. * @}
  77. */
  78. /** @defgroup BUS_LL_EC_APB1_GRP1_PERIPH APB1 GRP1 PERIPH
  79. * @{
  80. */
  81. #define LL_APB1_GRP1_PERIPH_ALL 0xFFFFFFFFU
  82. #define LL_APB1_GRP1_PERIPH_I2C1 RCC_APBENR1_I2CEN
  83. #define LL_APB1_GRP1_PERIPH_DBGMCU RCC_APBENR1_DBGEN
  84. #define LL_APB1_GRP1_PERIPH_PWR RCC_APBENR1_PWREN
  85. #define LL_APB1_GRP1_PERIPH_LPTIM1 RCC_APBENR1_LPTIMEN
  86. /**
  87. * @}
  88. */
  89. /** @defgroup BUS_LL_EC_APB1_GRP2_PERIPH APB1 GRP2 PERIPH
  90. * @{
  91. */
  92. #define LL_APB1_GRP2_PERIPH_ALL 0xFFFFFFFFU
  93. #define LL_APB1_GRP2_PERIPH_SYSCFG RCC_APBENR2_SYSCFGEN
  94. #define LL_APB1_GRP2_PERIPH_TIM1 RCC_APBENR2_TIM1EN
  95. #define LL_APB1_GRP2_PERIPH_SPI1 RCC_APBENR2_SPI1EN
  96. #define LL_APB1_GRP2_PERIPH_USART1 RCC_APBENR2_USART1EN
  97. #if defined(TIM14)
  98. #define LL_APB1_GRP2_PERIPH_TIM14 RCC_APBENR2_TIM14EN
  99. #endif
  100. #define LL_APB1_GRP2_PERIPH_ADC1 RCC_APBENR2_ADCEN
  101. #if defined(COMP1)
  102. #define LL_APB1_GRP2_PERIPH_COMP1 RCC_APBENR2_COMP1EN
  103. #endif
  104. #if defined(COMP2)
  105. #define LL_APB1_GRP2_PERIPH_COMP2 RCC_APBENR2_COMP2EN
  106. #endif
  107. /**
  108. * @}
  109. */
  110. /** @defgroup BUS_LL_EC_IOP_GRP1_PERIPH IOP GRP1 PERIPH
  111. * @{
  112. */
  113. #define LL_IOP_GRP1_PERIPH_ALL 0xFFFFFFFFU
  114. #define LL_IOP_GRP1_PERIPH_GPIOA RCC_IOPENR_GPIOAEN
  115. #define LL_IOP_GRP1_PERIPH_GPIOB RCC_IOPENR_GPIOBEN
  116. #define LL_IOP_GRP1_PERIPH_GPIOC RCC_IOPENR_GPIOCEN
  117. /**
  118. * @}
  119. */
  120. /**
  121. * @}
  122. */
  123. /* Exported macro ------------------------------------------------------------*/
  124. /* Exported functions --------------------------------------------------------*/
  125. /** @defgroup BUS_LL_Exported_Functions BUS Exported Functions
  126. * @{
  127. */
  128. /** @defgroup BUS_LL_EF_AHB1 AHB1
  129. * @{
  130. */
  131. /**
  132. * @brief Enable AHB1 peripherals clock.
  133. * @param Periphs This parameter can be a combination of the following values:
  134. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  135. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM
  136. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  137. * @note Depending on devices and packages, some peripherals may not be available.
  138. * Refer to device datasheet for peripherals availability.
  139. * @retval None
  140. */
  141. __STATIC_INLINE void LL_AHB1_GRP1_EnableClock(uint32_t Periphs)
  142. {
  143. __IO uint32_t tmpreg;
  144. SET_BIT(RCC->AHBENR, Periphs);
  145. /* Delay after an RCC peripheral clock enabling */
  146. tmpreg = READ_BIT(RCC->AHBENR, Periphs);
  147. (void)tmpreg;
  148. }
  149. /**
  150. * @brief Check if AHB1 peripheral clock is enabled or not
  151. * @param Periphs This parameter can be a combination of the following values:
  152. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  153. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM
  154. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  155. * @note Depending on devices and packages, some peripherals may not be available.
  156. * Refer to device datasheet for peripherals availability.
  157. * @retval State of Periphs (1 or 0).
  158. */
  159. __STATIC_INLINE uint32_t LL_AHB1_GRP1_IsEnabledClock(uint32_t Periphs)
  160. {
  161. return ((READ_BIT(RCC->AHBENR, Periphs) == Periphs) ? 1UL : 0UL);
  162. }
  163. /**
  164. * @brief Disable AHB1 peripherals clock.
  165. * @param Periphs This parameter can be a combination of the following values:
  166. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  167. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM
  168. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  169. * @note Depending on devices and packages, some peripherals may not be available.
  170. * Refer to device datasheet for peripherals availability.
  171. * @retval None
  172. */
  173. __STATIC_INLINE void LL_AHB1_GRP1_DisableClock(uint32_t Periphs)
  174. {
  175. CLEAR_BIT(RCC->AHBENR, Periphs);
  176. }
  177. /**
  178. * @brief Force AHB1 peripherals reset.
  179. * @param Periphs This parameter can be a combination of the following values:
  180. * @arg @ref LL_AHB1_GRP1_PERIPH_ALL
  181. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  182. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  183. * @note Depending on devices and packages, some peripherals may not be available.
  184. * Refer to device datasheet for peripherals availability.
  185. * @retval None
  186. */
  187. __STATIC_INLINE void LL_AHB1_GRP1_ForceReset(uint32_t Periphs)
  188. {
  189. SET_BIT(RCC->AHBRSTR, Periphs);
  190. }
  191. /**
  192. * @brief Release AHB1 peripherals reset.
  193. * @param Periphs This parameter can be a combination of the following values:
  194. * @arg @ref LL_AHB1_GRP1_PERIPH_ALL
  195. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  196. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  197. * @note Depending on devices and packages, some peripherals may not be available.
  198. * Refer to device datasheet for peripherals availability.
  199. * @retval None
  200. */
  201. __STATIC_INLINE void LL_AHB1_GRP1_ReleaseReset(uint32_t Periphs)
  202. {
  203. CLEAR_BIT(RCC->AHBRSTR, Periphs);
  204. }
  205. /**
  206. * @}
  207. */
  208. /** @defgroup BUS_LL_EF_APB1_GRP1 APB1 GRP1
  209. * @{
  210. */
  211. /**
  212. * @brief Enable APB1 GRP1 peripherals clock.
  213. * @param Periphs This parameter can be a combination of the following values:
  214. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  215. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  216. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  217. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  218. * @note Depending on devices and packages, some peripherals may not be available.
  219. * Refer to device datasheet for peripherals availability.
  220. * @retval None
  221. */
  222. __STATIC_INLINE void LL_APB1_GRP1_EnableClock(uint32_t Periphs)
  223. {
  224. __IO uint32_t tmpreg;
  225. SET_BIT(RCC->APBENR1, Periphs);
  226. /* Delay after an RCC peripheral clock enabling */
  227. tmpreg = READ_BIT(RCC->APBENR1, Periphs);
  228. (void)tmpreg;
  229. }
  230. /**
  231. * @brief Check if APB1 GRP1 peripheral clock is enabled or not
  232. * @param Periphs This parameter can be a combination of the following values:
  233. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  234. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  235. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  236. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  237. * @note Depending on devices and packages, some peripherals may not be available.
  238. * Refer to device datasheet for peripherals availability.
  239. * @retval State of Periphs (1 or 0).
  240. */
  241. __STATIC_INLINE uint32_t LL_APB1_GRP1_IsEnabledClock(uint32_t Periphs)
  242. {
  243. return ((READ_BIT(RCC->APBENR1, Periphs) == (Periphs)) ? 1UL : 0UL);
  244. }
  245. /**
  246. * @brief Disable APB1 GRP1 peripherals clock.
  247. * @param Periphs This parameter can be a combination of the following values:
  248. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  249. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  250. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  251. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  252. * @note Depending on devices and packages, some peripherals may not be available.
  253. * Refer to device datasheet for peripherals availability.
  254. * @retval None
  255. */
  256. __STATIC_INLINE void LL_APB1_GRP1_DisableClock(uint32_t Periphs)
  257. {
  258. CLEAR_BIT(RCC->APBENR1, Periphs);
  259. }
  260. /**
  261. * @brief Force APB1 GRP1 peripherals reset.
  262. * @param Periphs This parameter can be a combination of the following values:
  263. * @arg @ref LL_APB1_GRP1_PERIPH_ALL
  264. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  265. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  266. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  267. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  268. * @note Depending on devices and packages, some peripherals may not be available.
  269. * Refer to device datasheet for peripherals availability.
  270. * @retval None
  271. */
  272. __STATIC_INLINE void LL_APB1_GRP1_ForceReset(uint32_t Periphs)
  273. {
  274. SET_BIT(RCC->APBRSTR1, Periphs);
  275. }
  276. /**
  277. * @brief Release APB1 GRP1 peripherals reset.
  278. * @param Periphs This parameter can be a combination of the following values:
  279. * @arg @ref LL_APB1_GRP1_PERIPH_ALL
  280. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  281. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  282. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  283. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  284. * @note Depending on devices and packages, some peripherals may not be available.
  285. * Refer to device datasheet for peripherals availability.
  286. * @retval None
  287. */
  288. __STATIC_INLINE void LL_APB1_GRP1_ReleaseReset(uint32_t Periphs)
  289. {
  290. CLEAR_BIT(RCC->APBRSTR1, Periphs);
  291. }
  292. /**
  293. * @}
  294. */
  295. /** @defgroup BUS_LL_EF_APB1_GRP2 APB1 GRP2
  296. * @{
  297. */
  298. /**
  299. * @brief Enable APB1 GRP2 peripherals clock.
  300. * @param Periphs This parameter can be a combination of the following values:
  301. * @arg @ref LL_APB1_GRP2_PERIPH_SYSCFG
  302. * @arg @ref LL_APB1_GRP2_PERIPH_TIM1
  303. * @arg @ref LL_APB1_GRP2_PERIPH_SPI1
  304. * @arg @ref LL_APB1_GRP2_PERIPH_USART1
  305. * @arg @ref LL_APB1_GRP2_PERIPH_TIM14
  306. * @arg @ref LL_APB1_GRP2_PERIPH_ADC1
  307. * @arg @ref LL_APB1_GRP2_PERIPH_COMP1
  308. * @arg @ref LL_APB1_GRP2_PERIPH_COMP2
  309. * @note Depending on devices and packages, some peripherals may not be available.
  310. * Refer to device datasheet for peripherals availability.
  311. * @retval None
  312. */
  313. __STATIC_INLINE void LL_APB1_GRP2_EnableClock(uint32_t Periphs)
  314. {
  315. __IO uint32_t tmpreg;
  316. SET_BIT(RCC->APBENR2, Periphs);
  317. /* Delay after an RCC peripheral clock enabling */
  318. tmpreg = READ_BIT(RCC->APBENR2, Periphs);
  319. (void)tmpreg;
  320. }
  321. /**
  322. * @brief Check if APB1 GRP2 peripheral clock is enabled or not
  323. * @param Periphs This parameter can be a combination of the following values:
  324. * @arg @ref LL_APB1_GRP2_PERIPH_SYSCFG
  325. * @arg @ref LL_APB1_GRP2_PERIPH_TIM1
  326. * @arg @ref LL_APB1_GRP2_PERIPH_SPI1
  327. * @arg @ref LL_APB1_GRP2_PERIPH_USART1
  328. * @arg @ref LL_APB1_GRP2_PERIPH_TIM14
  329. * @arg @ref LL_APB1_GRP2_PERIPH_ADC1
  330. * @arg @ref LL_APB1_GRP2_PERIPH_COMP1
  331. * @arg @ref LL_APB1_GRP2_PERIPH_COMP2
  332. * @note Depending on devices and packages, some peripherals may not be available.
  333. * Refer to device datasheet for peripherals availability.
  334. * @retval State of Periphs (1 or 0).
  335. */
  336. __STATIC_INLINE uint32_t LL_APB1_GRP2_IsEnabledClock(uint32_t Periphs)
  337. {
  338. return ((READ_BIT(RCC->APBENR2, Periphs) == (Periphs)) ? 1UL : 0UL);
  339. }
  340. /**
  341. * @brief Disable APB1 GRP2 peripherals clock.
  342. * @param Periphs This parameter can be a combination of the following values:
  343. * @arg @ref LL_APB1_GRP2_PERIPH_SYSCFG
  344. * @arg @ref LL_APB1_GRP2_PERIPH_TIM1
  345. * @arg @ref LL_APB1_GRP2_PERIPH_SPI1
  346. * @arg @ref LL_APB1_GRP2_PERIPH_USART1
  347. * @arg @ref LL_APB1_GRP2_PERIPH_TIM14
  348. * @arg @ref LL_APB1_GRP2_PERIPH_ADC1
  349. * @arg @ref LL_APB1_GRP2_PERIPH_COMP1
  350. * @arg @ref LL_APB1_GRP2_PERIPH_COMP2
  351. * @note Depending on devices and packages, some peripherals may not be available.
  352. * Refer to device datasheet for peripherals availability.
  353. * @retval None
  354. */
  355. __STATIC_INLINE void LL_APB1_GRP2_DisableClock(uint32_t Periphs)
  356. {
  357. CLEAR_BIT(RCC->APBENR2, Periphs);
  358. }
  359. /**
  360. * @brief Force APB1 GRP2 peripherals reset.
  361. * @param Periphs This parameter can be a combination of the following values:
  362. * @arg @ref LL_APB1_GRP2_PERIPH_ALL
  363. * @arg @ref LL_APB1_GRP2_PERIPH_SYSCFG
  364. * @arg @ref LL_APB1_GRP2_PERIPH_TIM1
  365. * @arg @ref LL_APB1_GRP2_PERIPH_SPI1
  366. * @arg @ref LL_APB1_GRP2_PERIPH_USART1
  367. * @arg @ref LL_APB1_GRP2_PERIPH_TIM14
  368. * @arg @ref LL_APB1_GRP2_PERIPH_ADC1
  369. * @arg @ref LL_APB1_GRP2_PERIPH_COMP1
  370. * @arg @ref LL_APB1_GRP2_PERIPH_COMP2
  371. * @note Depending on devices and packages, some peripherals may not be available.
  372. * Refer to device datasheet for peripherals availability.
  373. * @retval None
  374. */
  375. __STATIC_INLINE void LL_APB1_GRP2_ForceReset(uint32_t Periphs)
  376. {
  377. SET_BIT(RCC->APBRSTR2, Periphs);
  378. }
  379. /**
  380. * @brief Release APB1 GRP2 peripherals reset.
  381. * @param Periphs This parameter can be a combination of the following values:
  382. * @arg @ref LL_APB1_GRP2_PERIPH_ALL
  383. * @arg @ref LL_APB1_GRP2_PERIPH_SYSCFG
  384. * @arg @ref LL_APB1_GRP2_PERIPH_TIM1
  385. * @arg @ref LL_APB1_GRP2_PERIPH_SPI1
  386. * @arg @ref LL_APB1_GRP2_PERIPH_USART1
  387. * @arg @ref LL_APB1_GRP2_PERIPH_TIM14
  388. * @arg @ref LL_APB1_GRP2_PERIPH_ADC1
  389. * @arg @ref LL_APB1_GRP2_PERIPH_COMP1
  390. * @arg @ref LL_APB1_GRP2_PERIPH_COMP2
  391. * @note Depending on devices and packages, some peripherals may not be available.
  392. * Refer to device datasheet for peripherals availability.
  393. * @note (*) peripheral not available on all devices
  394. * @retval None
  395. */
  396. __STATIC_INLINE void LL_APB1_GRP2_ReleaseReset(uint32_t Periphs)
  397. {
  398. CLEAR_BIT(RCC->APBRSTR2, Periphs);
  399. }
  400. /**
  401. * @}
  402. */
  403. /** @defgroup BUS_LL_EF_IOP IOP
  404. * @{
  405. */
  406. /**
  407. * @brief Enable IOP peripherals clock.
  408. * @param Periphs This parameter can be a combination of the following values:
  409. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  410. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  411. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  412. * @retval None
  413. */
  414. __STATIC_INLINE void LL_IOP_GRP1_EnableClock(uint32_t Periphs)
  415. {
  416. __IO uint32_t tmpreg;
  417. SET_BIT(RCC->IOPENR, Periphs);
  418. /* Delay after an RCC peripheral clock enabling */
  419. tmpreg = READ_BIT(RCC->IOPENR, Periphs);
  420. (void)tmpreg;
  421. }
  422. /**
  423. * @brief Check if IOP peripheral clock is enabled or not
  424. * @param Periphs This parameter can be a combination of the following values:
  425. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  426. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  427. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  428. * @retval State of Periphs (1 or 0).
  429. */
  430. __STATIC_INLINE uint32_t LL_IOP_GRP1_IsEnabledClock(uint32_t Periphs)
  431. {
  432. return ((READ_BIT(RCC->IOPENR, Periphs) == Periphs) ? 1UL : 0UL);
  433. }
  434. /**
  435. * @brief Disable IOP peripherals clock.
  436. * @param Periphs This parameter can be a combination of the following values:
  437. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  438. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  439. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  440. * @retval None
  441. */
  442. __STATIC_INLINE void LL_IOP_GRP1_DisableClock(uint32_t Periphs)
  443. {
  444. CLEAR_BIT(RCC->IOPENR, Periphs);
  445. }
  446. /**
  447. * @brief Disable IOP peripherals clock.
  448. * @param Periphs This parameter can be a combination of the following values:
  449. * @arg @ref LL_IOP_GRP1_PERIPH_ALL
  450. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  451. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  452. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  453. * @retval None
  454. */
  455. __STATIC_INLINE void LL_IOP_GRP1_ForceReset(uint32_t Periphs)
  456. {
  457. SET_BIT(RCC->IOPRSTR, Periphs);
  458. }
  459. /**
  460. * @brief Release IOP peripherals reset.
  461. * @param Periphs This parameter can be a combination of the following values:
  462. * @arg @ref LL_IOP_GRP1_PERIPH_ALL
  463. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  464. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  465. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  466. * @retval None
  467. */
  468. __STATIC_INLINE void LL_IOP_GRP1_ReleaseReset(uint32_t Periphs)
  469. {
  470. CLEAR_BIT(RCC->IOPRSTR, Periphs);
  471. }
  472. /**
  473. * @}
  474. */
  475. /**
  476. * @}
  477. */
  478. /**
  479. * @}
  480. */
  481. #endif /* RCC */
  482. /**
  483. * @}
  484. */
  485. #ifdef __cplusplus
  486. }
  487. #endif
  488. #endif /* PY32F002B_LL_BUS_H */
  489. /************************ (C) COPYRIGHT Puya *****END OF FILE****/