stm32f0xx_ll_bus.h 36 KB

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