stm32f0xx_ll_bus.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845
  1. /**
  2. ******************************************************************************
  3. * @file stm32f0xx_ll_bus.h
  4. * @author MCD 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 & APB peripherals, 1 dummy read is necessary
  15. [..]
  16. Workarounds:
  17. (#) For AHB & APB 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) 2016 STMicroelectronics.
  24. * All rights reserved.</center></h2>
  25. *
  26. * This software component is licensed by ST 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. */
  33. /* Define to prevent recursive inclusion -------------------------------------*/
  34. #ifndef __STM32F0xx_LL_BUS_H
  35. #define __STM32F0xx_LL_BUS_H
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. /* Includes ------------------------------------------------------------------*/
  40. #include "stm32f0xx.h"
  41. /** @addtogroup STM32F0xx_LL_Driver
  42. * @{
  43. */
  44. #if defined(RCC)
  45. /** @defgroup BUS_LL BUS
  46. * @{
  47. */
  48. /* Private types -------------------------------------------------------------*/
  49. /* Private variables ---------------------------------------------------------*/
  50. /* Private constants ---------------------------------------------------------*/
  51. /* Private macros ------------------------------------------------------------*/
  52. /* Exported types ------------------------------------------------------------*/
  53. /* Exported constants --------------------------------------------------------*/
  54. /** @defgroup BUS_LL_Exported_Constants BUS Exported Constants
  55. * @{
  56. */
  57. /** @defgroup BUS_LL_EC_AHB1_GRP1_PERIPH AHB1 GRP1 PERIPH
  58. * @{
  59. */
  60. #define LL_AHB1_GRP1_PERIPH_ALL (uint32_t)0xFFFFFFFFU
  61. #define LL_AHB1_GRP1_PERIPH_DMA1 RCC_AHBENR_DMA1EN
  62. #if defined(DMA2)
  63. #define LL_AHB1_GRP1_PERIPH_DMA2 RCC_AHBENR_DMA2EN
  64. #endif /*DMA2*/
  65. #define LL_AHB1_GRP1_PERIPH_SRAM RCC_AHBENR_SRAMEN
  66. #define LL_AHB1_GRP1_PERIPH_FLASH RCC_AHBENR_FLITFEN
  67. #define LL_AHB1_GRP1_PERIPH_CRC RCC_AHBENR_CRCEN
  68. #define LL_AHB1_GRP1_PERIPH_GPIOA RCC_AHBENR_GPIOAEN
  69. #define LL_AHB1_GRP1_PERIPH_GPIOB RCC_AHBENR_GPIOBEN
  70. #define LL_AHB1_GRP1_PERIPH_GPIOC RCC_AHBENR_GPIOCEN
  71. #if defined(GPIOD)
  72. #define LL_AHB1_GRP1_PERIPH_GPIOD RCC_AHBENR_GPIODEN
  73. #endif /*GPIOD*/
  74. #if defined(GPIOE)
  75. #define LL_AHB1_GRP1_PERIPH_GPIOE RCC_AHBENR_GPIOEEN
  76. #endif /*GPIOE*/
  77. #define LL_AHB1_GRP1_PERIPH_GPIOF RCC_AHBENR_GPIOFEN
  78. #if defined(TSC)
  79. #define LL_AHB1_GRP1_PERIPH_TSC RCC_AHBENR_TSCEN
  80. #endif /*TSC*/
  81. /**
  82. * @}
  83. */
  84. /** @defgroup BUS_LL_EC_APB1_GRP1_PERIPH APB1 GRP1 PERIPH
  85. * @{
  86. */
  87. #define LL_APB1_GRP1_PERIPH_ALL (uint32_t)0xFFFFFFFFU
  88. #if defined(TIM2)
  89. #define LL_APB1_GRP1_PERIPH_TIM2 RCC_APB1ENR_TIM2EN
  90. #endif /*TIM2*/
  91. #define LL_APB1_GRP1_PERIPH_TIM3 RCC_APB1ENR_TIM3EN
  92. #if defined(TIM6)
  93. #define LL_APB1_GRP1_PERIPH_TIM6 RCC_APB1ENR_TIM6EN
  94. #endif /*TIM6*/
  95. #if defined(TIM7)
  96. #define LL_APB1_GRP1_PERIPH_TIM7 RCC_APB1ENR_TIM7EN
  97. #endif /*TIM7*/
  98. #define LL_APB1_GRP1_PERIPH_TIM14 RCC_APB1ENR_TIM14EN
  99. #define LL_APB1_GRP1_PERIPH_WWDG RCC_APB1ENR_WWDGEN
  100. #if defined(SPI2)
  101. #define LL_APB1_GRP1_PERIPH_SPI2 RCC_APB1ENR_SPI2EN
  102. #endif /*SPI2*/
  103. #if defined(USART2)
  104. #define LL_APB1_GRP1_PERIPH_USART2 RCC_APB1ENR_USART2EN
  105. #endif /* USART2 */
  106. #if defined(USART3)
  107. #define LL_APB1_GRP1_PERIPH_USART3 RCC_APB1ENR_USART3EN
  108. #endif /* USART3 */
  109. #if defined(USART4)
  110. #define LL_APB1_GRP1_PERIPH_USART4 RCC_APB1ENR_USART4EN
  111. #endif /* USART4 */
  112. #if defined(USART5)
  113. #define LL_APB1_GRP1_PERIPH_USART5 RCC_APB1ENR_USART5EN
  114. #endif /* USART5 */
  115. #define LL_APB1_GRP1_PERIPH_I2C1 RCC_APB1ENR_I2C1EN
  116. #if defined(I2C2)
  117. #define LL_APB1_GRP1_PERIPH_I2C2 RCC_APB1ENR_I2C2EN
  118. #endif /*I2C2*/
  119. #if defined(USB)
  120. #define LL_APB1_GRP1_PERIPH_USB RCC_APB1ENR_USBEN
  121. #endif /* USB */
  122. #if defined(CAN)
  123. #define LL_APB1_GRP1_PERIPH_CAN RCC_APB1ENR_CANEN
  124. #endif /*CAN*/
  125. #if defined(CRS)
  126. #define LL_APB1_GRP1_PERIPH_CRS RCC_APB1ENR_CRSEN
  127. #endif /*CRS*/
  128. #define LL_APB1_GRP1_PERIPH_PWR RCC_APB1ENR_PWREN
  129. #if defined(DAC)
  130. #define LL_APB1_GRP1_PERIPH_DAC1 RCC_APB1ENR_DACEN
  131. #endif /*DAC*/
  132. #if defined(CEC)
  133. #define LL_APB1_GRP1_PERIPH_CEC RCC_APB1ENR_CECEN
  134. #endif /*CEC*/
  135. /**
  136. * @}
  137. */
  138. /** @defgroup BUS_LL_EC_APB1_GRP2_PERIPH APB1 GRP2 PERIPH
  139. * @{
  140. */
  141. #define LL_APB1_GRP2_PERIPH_ALL (uint32_t)0xFFFFFFFFU
  142. #define LL_APB1_GRP2_PERIPH_SYSCFG RCC_APB2ENR_SYSCFGEN
  143. #define LL_APB1_GRP2_PERIPH_ADC1 RCC_APB2ENR_ADC1EN
  144. #if defined(USART8)
  145. #define LL_APB1_GRP2_PERIPH_USART8 RCC_APB2ENR_USART8EN
  146. #endif /*USART8*/
  147. #if defined(USART7)
  148. #define LL_APB1_GRP2_PERIPH_USART7 RCC_APB2ENR_USART7EN
  149. #endif /*USART7*/
  150. #if defined(USART6)
  151. #define LL_APB1_GRP2_PERIPH_USART6 RCC_APB2ENR_USART6EN
  152. #endif /*USART6*/
  153. #define LL_APB1_GRP2_PERIPH_TIM1 RCC_APB2ENR_TIM1EN
  154. #define LL_APB1_GRP2_PERIPH_SPI1 RCC_APB2ENR_SPI1EN
  155. #define LL_APB1_GRP2_PERIPH_USART1 RCC_APB2ENR_USART1EN
  156. #if defined(TIM15)
  157. #define LL_APB1_GRP2_PERIPH_TIM15 RCC_APB2ENR_TIM15EN
  158. #endif /*TIM15*/
  159. #define LL_APB1_GRP2_PERIPH_TIM16 RCC_APB2ENR_TIM16EN
  160. #define LL_APB1_GRP2_PERIPH_TIM17 RCC_APB2ENR_TIM17EN
  161. #define LL_APB1_GRP2_PERIPH_DBGMCU RCC_APB2ENR_DBGMCUEN
  162. /**
  163. * @}
  164. */
  165. /**
  166. * @}
  167. */
  168. /* Exported macro ------------------------------------------------------------*/
  169. /* Exported functions --------------------------------------------------------*/
  170. /** @defgroup BUS_LL_Exported_Functions BUS Exported Functions
  171. * @{
  172. */
  173. /** @defgroup BUS_LL_EF_AHB1 AHB1
  174. * @{
  175. */
  176. /**
  177. * @brief Enable AHB1 peripherals clock.
  178. * @rmtoll AHBENR DMA1EN LL_AHB1_GRP1_EnableClock\n
  179. * AHBENR DMA2EN LL_AHB1_GRP1_EnableClock\n
  180. * AHBENR SRAMEN LL_AHB1_GRP1_EnableClock\n
  181. * AHBENR FLITFEN LL_AHB1_GRP1_EnableClock\n
  182. * AHBENR CRCEN LL_AHB1_GRP1_EnableClock\n
  183. * AHBENR GPIOAEN LL_AHB1_GRP1_EnableClock\n
  184. * AHBENR GPIOBEN LL_AHB1_GRP1_EnableClock\n
  185. * AHBENR GPIOCEN LL_AHB1_GRP1_EnableClock\n
  186. * AHBENR GPIODEN LL_AHB1_GRP1_EnableClock\n
  187. * AHBENR GPIOEEN LL_AHB1_GRP1_EnableClock\n
  188. * AHBENR GPIOFEN LL_AHB1_GRP1_EnableClock\n
  189. * AHBENR TSCEN LL_AHB1_GRP1_EnableClock
  190. * @param Periphs This parameter can be a combination of the following values:
  191. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  192. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2 (*)
  193. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM
  194. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  195. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  196. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOA
  197. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOB
  198. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOC
  199. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOD (*)
  200. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOE (*)
  201. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOF
  202. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  203. *
  204. * (*) value not defined in all devices.
  205. * @retval None
  206. */
  207. __STATIC_INLINE void LL_AHB1_GRP1_EnableClock(uint32_t Periphs)
  208. {
  209. __IO uint32_t tmpreg;
  210. SET_BIT(RCC->AHBENR, Periphs);
  211. /* Delay after an RCC peripheral clock enabling */
  212. tmpreg = READ_BIT(RCC->AHBENR, Periphs);
  213. (void)tmpreg;
  214. }
  215. /**
  216. * @brief Check if AHB1 peripheral clock is enabled or not
  217. * @rmtoll AHBENR DMA1EN LL_AHB1_GRP1_IsEnabledClock\n
  218. * AHBENR DMA2EN LL_AHB1_GRP1_IsEnabledClock\n
  219. * AHBENR SRAMEN LL_AHB1_GRP1_IsEnabledClock\n
  220. * AHBENR FLITFEN LL_AHB1_GRP1_IsEnabledClock\n
  221. * AHBENR CRCEN LL_AHB1_GRP1_IsEnabledClock\n
  222. * AHBENR GPIOAEN LL_AHB1_GRP1_IsEnabledClock\n
  223. * AHBENR GPIOBEN LL_AHB1_GRP1_IsEnabledClock\n
  224. * AHBENR GPIOCEN LL_AHB1_GRP1_IsEnabledClock\n
  225. * AHBENR GPIODEN LL_AHB1_GRP1_IsEnabledClock\n
  226. * AHBENR GPIOEEN LL_AHB1_GRP1_IsEnabledClock\n
  227. * AHBENR GPIOFEN LL_AHB1_GRP1_IsEnabledClock\n
  228. * AHBENR TSCEN LL_AHB1_GRP1_IsEnabledClock
  229. * @param Periphs This parameter can be a combination of the following values:
  230. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  231. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2 (*)
  232. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM
  233. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  234. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  235. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOA
  236. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOB
  237. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOC
  238. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOD (*)
  239. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOE (*)
  240. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOF
  241. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  242. *
  243. * (*) value not defined in all devices.
  244. * @retval State of Periphs (1 or 0).
  245. */
  246. __STATIC_INLINE uint32_t LL_AHB1_GRP1_IsEnabledClock(uint32_t Periphs)
  247. {
  248. return (READ_BIT(RCC->AHBENR, Periphs) == Periphs);
  249. }
  250. /**
  251. * @brief Disable AHB1 peripherals clock.
  252. * @rmtoll AHBENR DMA1EN LL_AHB1_GRP1_DisableClock\n
  253. * AHBENR DMA2EN LL_AHB1_GRP1_DisableClock\n
  254. * AHBENR SRAMEN LL_AHB1_GRP1_DisableClock\n
  255. * AHBENR FLITFEN LL_AHB1_GRP1_DisableClock\n
  256. * AHBENR CRCEN LL_AHB1_GRP1_DisableClock\n
  257. * AHBENR GPIOAEN LL_AHB1_GRP1_DisableClock\n
  258. * AHBENR GPIOBEN LL_AHB1_GRP1_DisableClock\n
  259. * AHBENR GPIOCEN LL_AHB1_GRP1_DisableClock\n
  260. * AHBENR GPIODEN LL_AHB1_GRP1_DisableClock\n
  261. * AHBENR GPIOEEN LL_AHB1_GRP1_DisableClock\n
  262. * AHBENR GPIOFEN LL_AHB1_GRP1_DisableClock\n
  263. * AHBENR TSCEN LL_AHB1_GRP1_DisableClock
  264. * @param Periphs This parameter can be a combination of the following values:
  265. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  266. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2 (*)
  267. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM
  268. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  269. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  270. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOA
  271. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOB
  272. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOC
  273. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOD (*)
  274. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOE (*)
  275. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOF
  276. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  277. *
  278. * (*) value not defined in all devices.
  279. * @retval None
  280. */
  281. __STATIC_INLINE void LL_AHB1_GRP1_DisableClock(uint32_t Periphs)
  282. {
  283. CLEAR_BIT(RCC->AHBENR, Periphs);
  284. }
  285. /**
  286. * @brief Force AHB1 peripherals reset.
  287. * @rmtoll AHBRSTR GPIOARST LL_AHB1_GRP1_ForceReset\n
  288. * AHBRSTR GPIOBRST LL_AHB1_GRP1_ForceReset\n
  289. * AHBRSTR GPIOCRST LL_AHB1_GRP1_ForceReset\n
  290. * AHBRSTR GPIODRST LL_AHB1_GRP1_ForceReset\n
  291. * AHBRSTR GPIOERST LL_AHB1_GRP1_ForceReset\n
  292. * AHBRSTR GPIOFRST LL_AHB1_GRP1_ForceReset\n
  293. * AHBRSTR TSCRST LL_AHB1_GRP1_ForceReset
  294. * @param Periphs This parameter can be a combination of the following values:
  295. * @arg @ref LL_AHB1_GRP1_PERIPH_ALL
  296. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOA
  297. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOB
  298. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOC
  299. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOD (*)
  300. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOE (*)
  301. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOF
  302. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  303. *
  304. * (*) value not defined in all devices.
  305. * @retval None
  306. */
  307. __STATIC_INLINE void LL_AHB1_GRP1_ForceReset(uint32_t Periphs)
  308. {
  309. SET_BIT(RCC->AHBRSTR, Periphs);
  310. }
  311. /**
  312. * @brief Release AHB1 peripherals reset.
  313. * @rmtoll AHBRSTR GPIOARST LL_AHB1_GRP1_ReleaseReset\n
  314. * AHBRSTR GPIOBRST LL_AHB1_GRP1_ReleaseReset\n
  315. * AHBRSTR GPIOCRST LL_AHB1_GRP1_ReleaseReset\n
  316. * AHBRSTR GPIODRST LL_AHB1_GRP1_ReleaseReset\n
  317. * AHBRSTR GPIOERST LL_AHB1_GRP1_ReleaseReset\n
  318. * AHBRSTR GPIOFRST LL_AHB1_GRP1_ReleaseReset\n
  319. * AHBRSTR TSCRST LL_AHB1_GRP1_ReleaseReset
  320. * @param Periphs This parameter can be a combination of the following values:
  321. * @arg @ref LL_AHB1_GRP1_PERIPH_ALL
  322. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOA
  323. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOB
  324. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOC
  325. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOD (*)
  326. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOE (*)
  327. * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOF
  328. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  329. *
  330. * (*) value not defined in all devices.
  331. * @retval None
  332. */
  333. __STATIC_INLINE void LL_AHB1_GRP1_ReleaseReset(uint32_t Periphs)
  334. {
  335. CLEAR_BIT(RCC->AHBRSTR, Periphs);
  336. }
  337. /**
  338. * @}
  339. */
  340. /** @defgroup BUS_LL_EF_APB1_GRP1 APB1 GRP1
  341. * @{
  342. */
  343. /**
  344. * @brief Enable APB1 peripherals clock (available in register 1).
  345. * @rmtoll APB1ENR TIM2EN LL_APB1_GRP1_EnableClock\n
  346. * APB1ENR TIM3EN LL_APB1_GRP1_EnableClock\n
  347. * APB1ENR TIM6EN LL_APB1_GRP1_EnableClock\n
  348. * APB1ENR TIM7EN LL_APB1_GRP1_EnableClock\n
  349. * APB1ENR TIM14EN LL_APB1_GRP1_EnableClock\n
  350. * APB1ENR WWDGEN LL_APB1_GRP1_EnableClock\n
  351. * APB1ENR SPI2EN LL_APB1_GRP1_EnableClock\n
  352. * APB1ENR USART2EN LL_APB1_GRP1_EnableClock\n
  353. * APB1ENR USART3EN LL_APB1_GRP1_EnableClock\n
  354. * APB1ENR USART4EN LL_APB1_GRP1_EnableClock\n
  355. * APB1ENR USART5EN LL_APB1_GRP1_EnableClock\n
  356. * APB1ENR I2C1EN LL_APB1_GRP1_EnableClock\n
  357. * APB1ENR I2C2EN LL_APB1_GRP1_EnableClock\n
  358. * APB1ENR USBEN LL_APB1_GRP1_EnableClock\n
  359. * APB1ENR CANEN LL_APB1_GRP1_EnableClock\n
  360. * APB1ENR CRSEN LL_APB1_GRP1_EnableClock\n
  361. * APB1ENR PWREN LL_APB1_GRP1_EnableClock\n
  362. * APB1ENR DACEN LL_APB1_GRP1_EnableClock\n
  363. * APB1ENR CECEN LL_APB1_GRP1_EnableClock
  364. * @param Periphs This parameter can be a combination of the following values:
  365. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (*)
  366. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  367. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  368. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  369. * @arg @ref LL_APB1_GRP1_PERIPH_TIM14
  370. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  371. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  372. * @arg @ref LL_APB1_GRP1_PERIPH_USART2 (*)
  373. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  374. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  375. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  376. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  377. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  378. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  379. * @arg @ref LL_APB1_GRP1_PERIPH_CAN (*)
  380. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  381. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  382. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  383. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (*)
  384. *
  385. * (*) value not defined in all devices.
  386. * @retval None
  387. */
  388. __STATIC_INLINE void LL_APB1_GRP1_EnableClock(uint32_t Periphs)
  389. {
  390. __IO uint32_t tmpreg;
  391. SET_BIT(RCC->APB1ENR, Periphs);
  392. /* Delay after an RCC peripheral clock enabling */
  393. tmpreg = READ_BIT(RCC->APB1ENR, Periphs);
  394. (void)tmpreg;
  395. }
  396. /**
  397. * @brief Check if APB1 peripheral clock is enabled or not (available in register 1).
  398. * @rmtoll APB1ENR TIM2EN LL_APB1_GRP1_IsEnabledClock\n
  399. * APB1ENR TIM3EN LL_APB1_GRP1_IsEnabledClock\n
  400. * APB1ENR TIM6EN LL_APB1_GRP1_IsEnabledClock\n
  401. * APB1ENR TIM7EN LL_APB1_GRP1_IsEnabledClock\n
  402. * APB1ENR TIM14EN LL_APB1_GRP1_IsEnabledClock\n
  403. * APB1ENR WWDGEN LL_APB1_GRP1_IsEnabledClock\n
  404. * APB1ENR SPI2EN LL_APB1_GRP1_IsEnabledClock\n
  405. * APB1ENR USART2EN LL_APB1_GRP1_IsEnabledClock\n
  406. * APB1ENR USART3EN LL_APB1_GRP1_IsEnabledClock\n
  407. * APB1ENR USART4EN LL_APB1_GRP1_IsEnabledClock\n
  408. * APB1ENR USART5EN LL_APB1_GRP1_IsEnabledClock\n
  409. * APB1ENR I2C1EN LL_APB1_GRP1_IsEnabledClock\n
  410. * APB1ENR I2C2EN LL_APB1_GRP1_IsEnabledClock\n
  411. * APB1ENR USBEN LL_APB1_GRP1_IsEnabledClock\n
  412. * APB1ENR CANEN LL_APB1_GRP1_IsEnabledClock\n
  413. * APB1ENR CRSEN LL_APB1_GRP1_IsEnabledClock\n
  414. * APB1ENR PWREN LL_APB1_GRP1_IsEnabledClock\n
  415. * APB1ENR DACEN LL_APB1_GRP1_IsEnabledClock\n
  416. * APB1ENR CECEN LL_APB1_GRP1_IsEnabledClock
  417. * @param Periphs This parameter can be a combination of the following values:
  418. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (*)
  419. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  420. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  421. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  422. * @arg @ref LL_APB1_GRP1_PERIPH_TIM14
  423. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  424. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  425. * @arg @ref LL_APB1_GRP1_PERIPH_USART2 (*)
  426. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  427. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  428. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  429. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  430. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  431. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  432. * @arg @ref LL_APB1_GRP1_PERIPH_CAN (*)
  433. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  434. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  435. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  436. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (*)
  437. *
  438. * (*) value not defined in all devices.
  439. * @retval State of Periphs (1 or 0).
  440. */
  441. __STATIC_INLINE uint32_t LL_APB1_GRP1_IsEnabledClock(uint32_t Periphs)
  442. {
  443. return (READ_BIT(RCC->APB1ENR, Periphs) == Periphs);
  444. }
  445. /**
  446. * @brief Disable APB1 peripherals clock (available in register 1).
  447. * @rmtoll APB1ENR TIM2EN LL_APB1_GRP1_DisableClock\n
  448. * APB1ENR TIM3EN LL_APB1_GRP1_DisableClock\n
  449. * APB1ENR TIM6EN LL_APB1_GRP1_DisableClock\n
  450. * APB1ENR TIM7EN LL_APB1_GRP1_DisableClock\n
  451. * APB1ENR TIM14EN LL_APB1_GRP1_DisableClock\n
  452. * APB1ENR WWDGEN LL_APB1_GRP1_DisableClock\n
  453. * APB1ENR SPI2EN LL_APB1_GRP1_DisableClock\n
  454. * APB1ENR USART2EN LL_APB1_GRP1_DisableClock\n
  455. * APB1ENR USART3EN LL_APB1_GRP1_DisableClock\n
  456. * APB1ENR USART4EN LL_APB1_GRP1_DisableClock\n
  457. * APB1ENR USART5EN LL_APB1_GRP1_DisableClock\n
  458. * APB1ENR I2C1EN LL_APB1_GRP1_DisableClock\n
  459. * APB1ENR I2C2EN LL_APB1_GRP1_DisableClock\n
  460. * APB1ENR USBEN LL_APB1_GRP1_DisableClock\n
  461. * APB1ENR CANEN LL_APB1_GRP1_DisableClock\n
  462. * APB1ENR CRSEN LL_APB1_GRP1_DisableClock\n
  463. * APB1ENR PWREN LL_APB1_GRP1_DisableClock\n
  464. * APB1ENR DACEN LL_APB1_GRP1_DisableClock\n
  465. * APB1ENR CECEN LL_APB1_GRP1_DisableClock
  466. * @param Periphs This parameter can be a combination of the following values:
  467. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (*)
  468. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  469. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  470. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  471. * @arg @ref LL_APB1_GRP1_PERIPH_TIM14
  472. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  473. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  474. * @arg @ref LL_APB1_GRP1_PERIPH_USART2 (*)
  475. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  476. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  477. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  478. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  479. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  480. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  481. * @arg @ref LL_APB1_GRP1_PERIPH_CAN (*)
  482. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  483. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  484. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  485. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (*)
  486. *
  487. * (*) value not defined in all devices.
  488. * @retval None
  489. */
  490. __STATIC_INLINE void LL_APB1_GRP1_DisableClock(uint32_t Periphs)
  491. {
  492. CLEAR_BIT(RCC->APB1ENR, Periphs);
  493. }
  494. /**
  495. * @brief Force APB1 peripherals reset (available in register 1).
  496. * @rmtoll APB1RSTR TIM2RST LL_APB1_GRP1_ForceReset\n
  497. * APB1RSTR TIM3RST LL_APB1_GRP1_ForceReset\n
  498. * APB1RSTR TIM6RST LL_APB1_GRP1_ForceReset\n
  499. * APB1RSTR TIM7RST LL_APB1_GRP1_ForceReset\n
  500. * APB1RSTR TIM14RST LL_APB1_GRP1_ForceReset\n
  501. * APB1RSTR WWDGRST LL_APB1_GRP1_ForceReset\n
  502. * APB1RSTR SPI2RST LL_APB1_GRP1_ForceReset\n
  503. * APB1RSTR USART2RST LL_APB1_GRP1_ForceReset\n
  504. * APB1RSTR USART3RST LL_APB1_GRP1_ForceReset\n
  505. * APB1RSTR USART4RST LL_APB1_GRP1_ForceReset\n
  506. * APB1RSTR USART5RST LL_APB1_GRP1_ForceReset\n
  507. * APB1RSTR I2C1RST LL_APB1_GRP1_ForceReset\n
  508. * APB1RSTR I2C2RST LL_APB1_GRP1_ForceReset\n
  509. * APB1RSTR USBRST LL_APB1_GRP1_ForceReset\n
  510. * APB1RSTR CANRST LL_APB1_GRP1_ForceReset\n
  511. * APB1RSTR CRSRST LL_APB1_GRP1_ForceReset\n
  512. * APB1RSTR PWRRST LL_APB1_GRP1_ForceReset\n
  513. * APB1RSTR DACRST LL_APB1_GRP1_ForceReset\n
  514. * APB1RSTR CECRST LL_APB1_GRP1_ForceReset
  515. * @param Periphs This parameter can be a combination of the following values:
  516. * @arg @ref LL_APB1_GRP1_PERIPH_ALL
  517. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (*)
  518. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  519. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  520. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  521. * @arg @ref LL_APB1_GRP1_PERIPH_TIM14
  522. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  523. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  524. * @arg @ref LL_APB1_GRP1_PERIPH_USART2 (*)
  525. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  526. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  527. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  528. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  529. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  530. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  531. * @arg @ref LL_APB1_GRP1_PERIPH_CAN (*)
  532. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  533. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  534. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  535. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (*)
  536. *
  537. * (*) value not defined in all devices.
  538. * @retval None
  539. */
  540. __STATIC_INLINE void LL_APB1_GRP1_ForceReset(uint32_t Periphs)
  541. {
  542. SET_BIT(RCC->APB1RSTR, Periphs);
  543. }
  544. /**
  545. * @brief Release APB1 peripherals reset (available in register 1).
  546. * @rmtoll APB1RSTR TIM2RST LL_APB1_GRP1_ReleaseReset\n
  547. * APB1RSTR TIM3RST LL_APB1_GRP1_ReleaseReset\n
  548. * APB1RSTR TIM6RST LL_APB1_GRP1_ReleaseReset\n
  549. * APB1RSTR TIM7RST LL_APB1_GRP1_ReleaseReset\n
  550. * APB1RSTR TIM14RST LL_APB1_GRP1_ReleaseReset\n
  551. * APB1RSTR WWDGRST LL_APB1_GRP1_ReleaseReset\n
  552. * APB1RSTR SPI2RST LL_APB1_GRP1_ReleaseReset\n
  553. * APB1RSTR USART2RST LL_APB1_GRP1_ReleaseReset\n
  554. * APB1RSTR USART3RST LL_APB1_GRP1_ReleaseReset\n
  555. * APB1RSTR USART4RST LL_APB1_GRP1_ReleaseReset\n
  556. * APB1RSTR USART5RST LL_APB1_GRP1_ReleaseReset\n
  557. * APB1RSTR I2C1RST LL_APB1_GRP1_ReleaseReset\n
  558. * APB1RSTR I2C2RST LL_APB1_GRP1_ReleaseReset\n
  559. * APB1RSTR USBRST LL_APB1_GRP1_ReleaseReset\n
  560. * APB1RSTR CANRST LL_APB1_GRP1_ReleaseReset\n
  561. * APB1RSTR CRSRST LL_APB1_GRP1_ReleaseReset\n
  562. * APB1RSTR PWRRST LL_APB1_GRP1_ReleaseReset\n
  563. * APB1RSTR DACRST LL_APB1_GRP1_ReleaseReset\n
  564. * APB1RSTR CECRST LL_APB1_GRP1_ReleaseReset
  565. * @param Periphs This parameter can be a combination of the following values:
  566. * @arg @ref LL_APB1_GRP1_PERIPH_ALL
  567. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (*)
  568. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  569. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  570. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  571. * @arg @ref LL_APB1_GRP1_PERIPH_TIM14
  572. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  573. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  574. * @arg @ref LL_APB1_GRP1_PERIPH_USART2 (*)
  575. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  576. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  577. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  578. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  579. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  580. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  581. * @arg @ref LL_APB1_GRP1_PERIPH_CAN (*)
  582. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  583. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  584. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  585. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (*)
  586. *
  587. * (*) value not defined in all devices.
  588. * @retval None
  589. */
  590. __STATIC_INLINE void LL_APB1_GRP1_ReleaseReset(uint32_t Periphs)
  591. {
  592. CLEAR_BIT(RCC->APB1RSTR, Periphs);
  593. }
  594. /**
  595. * @}
  596. */
  597. /** @defgroup BUS_LL_EF_APB1_GRP2 APB1 GRP2
  598. * @{
  599. */
  600. /**
  601. * @brief Enable APB1 peripherals clock (available in register 2).
  602. * @rmtoll APB2ENR SYSCFGEN LL_APB1_GRP2_EnableClock\n
  603. * APB2ENR ADC1EN LL_APB1_GRP2_EnableClock\n
  604. * APB2ENR USART8EN LL_APB1_GRP2_EnableClock\n
  605. * APB2ENR USART7EN LL_APB1_GRP2_EnableClock\n
  606. * APB2ENR USART6EN LL_APB1_GRP2_EnableClock\n
  607. * APB2ENR TIM1EN LL_APB1_GRP2_EnableClock\n
  608. * APB2ENR SPI1EN LL_APB1_GRP2_EnableClock\n
  609. * APB2ENR USART1EN LL_APB1_GRP2_EnableClock\n
  610. * APB2ENR TIM15EN LL_APB1_GRP2_EnableClock\n
  611. * APB2ENR TIM16EN LL_APB1_GRP2_EnableClock\n
  612. * APB2ENR TIM17EN LL_APB1_GRP2_EnableClock\n
  613. * APB2ENR DBGMCUEN LL_APB1_GRP2_EnableClock
  614. * @param Periphs This parameter can be a combination of the following values:
  615. * @arg @ref LL_APB1_GRP2_PERIPH_SYSCFG
  616. * @arg @ref LL_APB1_GRP2_PERIPH_ADC1
  617. * @arg @ref LL_APB1_GRP2_PERIPH_USART8 (*)
  618. * @arg @ref LL_APB1_GRP2_PERIPH_USART7 (*)
  619. * @arg @ref LL_APB1_GRP2_PERIPH_USART6 (*)
  620. * @arg @ref LL_APB1_GRP2_PERIPH_TIM1
  621. * @arg @ref LL_APB1_GRP2_PERIPH_SPI1
  622. * @arg @ref LL_APB1_GRP2_PERIPH_USART1
  623. * @arg @ref LL_APB1_GRP2_PERIPH_TIM15 (*)
  624. * @arg @ref LL_APB1_GRP2_PERIPH_TIM16
  625. * @arg @ref LL_APB1_GRP2_PERIPH_TIM17
  626. * @arg @ref LL_APB1_GRP2_PERIPH_DBGMCU
  627. *
  628. * (*) value not defined in all devices.
  629. * @retval None
  630. */
  631. __STATIC_INLINE void LL_APB1_GRP2_EnableClock(uint32_t Periphs)
  632. {
  633. __IO uint32_t tmpreg;
  634. SET_BIT(RCC->APB2ENR, Periphs);
  635. /* Delay after an RCC peripheral clock enabling */
  636. tmpreg = READ_BIT(RCC->APB2ENR, Periphs);
  637. (void)tmpreg;
  638. }
  639. /**
  640. * @brief Check if APB1 peripheral clock is enabled or not (available in register 2).
  641. * @rmtoll APB2ENR SYSCFGEN LL_APB1_GRP2_IsEnabledClock\n
  642. * APB2ENR ADC1EN LL_APB1_GRP2_IsEnabledClock\n
  643. * APB2ENR USART8EN LL_APB1_GRP2_IsEnabledClock\n
  644. * APB2ENR USART7EN LL_APB1_GRP2_IsEnabledClock\n
  645. * APB2ENR USART6EN LL_APB1_GRP2_IsEnabledClock\n
  646. * APB2ENR TIM1EN LL_APB1_GRP2_IsEnabledClock\n
  647. * APB2ENR SPI1EN LL_APB1_GRP2_IsEnabledClock\n
  648. * APB2ENR USART1EN LL_APB1_GRP2_IsEnabledClock\n
  649. * APB2ENR TIM15EN LL_APB1_GRP2_IsEnabledClock\n
  650. * APB2ENR TIM16EN LL_APB1_GRP2_IsEnabledClock\n
  651. * APB2ENR TIM17EN LL_APB1_GRP2_IsEnabledClock\n
  652. * APB2ENR DBGMCUEN LL_APB1_GRP2_IsEnabledClock
  653. * @param Periphs This parameter can be a combination of the following values:
  654. * @arg @ref LL_APB1_GRP2_PERIPH_SYSCFG
  655. * @arg @ref LL_APB1_GRP2_PERIPH_ADC1
  656. * @arg @ref LL_APB1_GRP2_PERIPH_USART8 (*)
  657. * @arg @ref LL_APB1_GRP2_PERIPH_USART7 (*)
  658. * @arg @ref LL_APB1_GRP2_PERIPH_USART6 (*)
  659. * @arg @ref LL_APB1_GRP2_PERIPH_TIM1
  660. * @arg @ref LL_APB1_GRP2_PERIPH_SPI1
  661. * @arg @ref LL_APB1_GRP2_PERIPH_USART1
  662. * @arg @ref LL_APB1_GRP2_PERIPH_TIM15 (*)
  663. * @arg @ref LL_APB1_GRP2_PERIPH_TIM16
  664. * @arg @ref LL_APB1_GRP2_PERIPH_TIM17
  665. * @arg @ref LL_APB1_GRP2_PERIPH_DBGMCU
  666. *
  667. * (*) value not defined in all devices.
  668. * @retval State of Periphs (1 or 0).
  669. */
  670. __STATIC_INLINE uint32_t LL_APB1_GRP2_IsEnabledClock(uint32_t Periphs)
  671. {
  672. return (READ_BIT(RCC->APB2ENR, Periphs) == Periphs);
  673. }
  674. /**
  675. * @brief Disable APB1 peripherals clock (available in register 2).
  676. * @rmtoll APB2ENR SYSCFGEN LL_APB1_GRP2_DisableClock\n
  677. * APB2ENR ADC1EN LL_APB1_GRP2_DisableClock\n
  678. * APB2ENR USART8EN LL_APB1_GRP2_DisableClock\n
  679. * APB2ENR USART7EN LL_APB1_GRP2_DisableClock\n
  680. * APB2ENR USART6EN LL_APB1_GRP2_DisableClock\n
  681. * APB2ENR TIM1EN LL_APB1_GRP2_DisableClock\n
  682. * APB2ENR SPI1EN LL_APB1_GRP2_DisableClock\n
  683. * APB2ENR USART1EN LL_APB1_GRP2_DisableClock\n
  684. * APB2ENR TIM15EN LL_APB1_GRP2_DisableClock\n
  685. * APB2ENR TIM16EN LL_APB1_GRP2_DisableClock\n
  686. * APB2ENR TIM17EN LL_APB1_GRP2_DisableClock\n
  687. * APB2ENR DBGMCUEN LL_APB1_GRP2_DisableClock
  688. * @param Periphs This parameter can be a combination of the following values:
  689. * @arg @ref LL_APB1_GRP2_PERIPH_SYSCFG
  690. * @arg @ref LL_APB1_GRP2_PERIPH_ADC1
  691. * @arg @ref LL_APB1_GRP2_PERIPH_USART8 (*)
  692. * @arg @ref LL_APB1_GRP2_PERIPH_USART7 (*)
  693. * @arg @ref LL_APB1_GRP2_PERIPH_USART6 (*)
  694. * @arg @ref LL_APB1_GRP2_PERIPH_TIM1
  695. * @arg @ref LL_APB1_GRP2_PERIPH_SPI1
  696. * @arg @ref LL_APB1_GRP2_PERIPH_USART1
  697. * @arg @ref LL_APB1_GRP2_PERIPH_TIM15 (*)
  698. * @arg @ref LL_APB1_GRP2_PERIPH_TIM16
  699. * @arg @ref LL_APB1_GRP2_PERIPH_TIM17
  700. * @arg @ref LL_APB1_GRP2_PERIPH_DBGMCU
  701. *
  702. * (*) value not defined in all devices.
  703. * @retval None
  704. */
  705. __STATIC_INLINE void LL_APB1_GRP2_DisableClock(uint32_t Periphs)
  706. {
  707. CLEAR_BIT(RCC->APB2ENR, Periphs);
  708. }
  709. /**
  710. * @brief Force APB1 peripherals reset (available in register 2).
  711. * @rmtoll APB2RSTR SYSCFGRST LL_APB1_GRP2_ForceReset\n
  712. * APB2RSTR ADC1RST LL_APB1_GRP2_ForceReset\n
  713. * APB2RSTR USART8RST LL_APB1_GRP2_ForceReset\n
  714. * APB2RSTR USART7RST LL_APB1_GRP2_ForceReset\n
  715. * APB2RSTR USART6RST LL_APB1_GRP2_ForceReset\n
  716. * APB2RSTR TIM1RST LL_APB1_GRP2_ForceReset\n
  717. * APB2RSTR SPI1RST LL_APB1_GRP2_ForceReset\n
  718. * APB2RSTR USART1RST LL_APB1_GRP2_ForceReset\n
  719. * APB2RSTR TIM15RST LL_APB1_GRP2_ForceReset\n
  720. * APB2RSTR TIM16RST LL_APB1_GRP2_ForceReset\n
  721. * APB2RSTR TIM17RST LL_APB1_GRP2_ForceReset\n
  722. * APB2RSTR DBGMCURST LL_APB1_GRP2_ForceReset
  723. * @param Periphs This parameter can be a combination of the following values:
  724. * @arg @ref LL_APB1_GRP2_PERIPH_ALL
  725. * @arg @ref LL_APB1_GRP2_PERIPH_SYSCFG
  726. * @arg @ref LL_APB1_GRP2_PERIPH_ADC1
  727. * @arg @ref LL_APB1_GRP2_PERIPH_USART8 (*)
  728. * @arg @ref LL_APB1_GRP2_PERIPH_USART7 (*)
  729. * @arg @ref LL_APB1_GRP2_PERIPH_USART6 (*)
  730. * @arg @ref LL_APB1_GRP2_PERIPH_TIM1
  731. * @arg @ref LL_APB1_GRP2_PERIPH_SPI1
  732. * @arg @ref LL_APB1_GRP2_PERIPH_USART1
  733. * @arg @ref LL_APB1_GRP2_PERIPH_TIM15 (*)
  734. * @arg @ref LL_APB1_GRP2_PERIPH_TIM16
  735. * @arg @ref LL_APB1_GRP2_PERIPH_TIM17
  736. * @arg @ref LL_APB1_GRP2_PERIPH_DBGMCU
  737. *
  738. * (*) value not defined in all devices.
  739. * @retval None
  740. */
  741. __STATIC_INLINE void LL_APB1_GRP2_ForceReset(uint32_t Periphs)
  742. {
  743. SET_BIT(RCC->APB2RSTR, Periphs);
  744. }
  745. /**
  746. * @brief Release APB1 peripherals reset (available in register 2).
  747. * @rmtoll APB2RSTR SYSCFGRST LL_APB1_GRP2_ReleaseReset\n
  748. * APB2RSTR ADC1RST LL_APB1_GRP2_ReleaseReset\n
  749. * APB2RSTR USART8RST LL_APB1_GRP2_ReleaseReset\n
  750. * APB2RSTR USART7RST LL_APB1_GRP2_ReleaseReset\n
  751. * APB2RSTR USART6RST LL_APB1_GRP2_ReleaseReset\n
  752. * APB2RSTR TIM1RST LL_APB1_GRP2_ReleaseReset\n
  753. * APB2RSTR SPI1RST LL_APB1_GRP2_ReleaseReset\n
  754. * APB2RSTR USART1RST LL_APB1_GRP2_ReleaseReset\n
  755. * APB2RSTR TIM15RST LL_APB1_GRP2_ReleaseReset\n
  756. * APB2RSTR TIM16RST LL_APB1_GRP2_ReleaseReset\n
  757. * APB2RSTR TIM17RST LL_APB1_GRP2_ReleaseReset\n
  758. * APB2RSTR DBGMCURST LL_APB1_GRP2_ReleaseReset
  759. * @param Periphs This parameter can be a combination of the following values:
  760. * @arg @ref LL_APB1_GRP2_PERIPH_ALL
  761. * @arg @ref LL_APB1_GRP2_PERIPH_SYSCFG
  762. * @arg @ref LL_APB1_GRP2_PERIPH_ADC1
  763. * @arg @ref LL_APB1_GRP2_PERIPH_USART8 (*)
  764. * @arg @ref LL_APB1_GRP2_PERIPH_USART7 (*)
  765. * @arg @ref LL_APB1_GRP2_PERIPH_USART6 (*)
  766. * @arg @ref LL_APB1_GRP2_PERIPH_TIM1
  767. * @arg @ref LL_APB1_GRP2_PERIPH_SPI1
  768. * @arg @ref LL_APB1_GRP2_PERIPH_USART1
  769. * @arg @ref LL_APB1_GRP2_PERIPH_TIM15 (*)
  770. * @arg @ref LL_APB1_GRP2_PERIPH_TIM16
  771. * @arg @ref LL_APB1_GRP2_PERIPH_TIM17
  772. * @arg @ref LL_APB1_GRP2_PERIPH_DBGMCU
  773. *
  774. * (*) value not defined in all devices.
  775. * @retval None
  776. */
  777. __STATIC_INLINE void LL_APB1_GRP2_ReleaseReset(uint32_t Periphs)
  778. {
  779. CLEAR_BIT(RCC->APB2RSTR, Periphs);
  780. }
  781. /**
  782. * @}
  783. */
  784. /**
  785. * @}
  786. */
  787. /**
  788. * @}
  789. */
  790. #endif /* defined(RCC) */
  791. /**
  792. * @}
  793. */
  794. #ifdef __cplusplus
  795. }
  796. #endif
  797. #endif /* __STM32F0xx_LL_BUS_H */
  798. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/