stm32g0xx_ll_bus.h 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313
  1. /**
  2. ******************************************************************************
  3. * @file stm32g0xx_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) 2018 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 STM32G0xx_LL_BUS_H
  35. #define STM32G0xx_LL_BUS_H
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. /* Includes ------------------------------------------------------------------*/
  40. #include "stm32g0xx.h"
  41. /** @addtogroup STM32G0xx_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 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_FLASH RCC_AHBENR_FLASHEN
  66. #define LL_AHB1_GRP1_PERIPH_SRAM RCC_AHBSMENR_SRAMSMEN
  67. #if defined(CRC)
  68. #define LL_AHB1_GRP1_PERIPH_CRC RCC_AHBENR_CRCEN
  69. #endif /* CRC */
  70. #if defined(AES)
  71. #define LL_AHB1_GRP1_PERIPH_CRYP RCC_AHBENR_AESEN
  72. #endif /* AES */
  73. #if defined(RNG)
  74. #define LL_AHB1_GRP1_PERIPH_RNG RCC_AHBENR_RNGEN
  75. #endif /* RNG */
  76. /**
  77. * @}
  78. */
  79. /** @defgroup BUS_LL_EC_APB1_GRP1_PERIPH APB1 GRP1 PERIPH
  80. * @{
  81. */
  82. #define LL_APB1_GRP1_PERIPH_ALL 0xFFFFFFFFU
  83. #if defined(TIM2)
  84. #define LL_APB1_GRP1_PERIPH_TIM2 RCC_APBENR1_TIM2EN
  85. #endif /* TIM2 */
  86. #if defined(TIM3)
  87. #define LL_APB1_GRP1_PERIPH_TIM3 RCC_APBENR1_TIM3EN
  88. #endif /* TIM3 */
  89. #if defined(TIM4)
  90. #define LL_APB1_GRP1_PERIPH_TIM4 RCC_APBENR1_TIM4EN
  91. #endif /* TIM4 */
  92. #if defined(TIM6)
  93. #define LL_APB1_GRP1_PERIPH_TIM6 RCC_APBENR1_TIM6EN
  94. #endif /* TIM6 */
  95. #if defined(TIM7)
  96. #define LL_APB1_GRP1_PERIPH_TIM7 RCC_APBENR1_TIM7EN
  97. #endif /* TIM7 */
  98. #if defined(LPUART2)
  99. #define LL_APB1_GRP1_PERIPH_LPUART2 RCC_APBENR1_LPUART2EN
  100. #endif /* LPUART2 */
  101. #if defined(USART5)
  102. #define LL_APB1_GRP1_PERIPH_USART5 RCC_APBENR1_USART5EN
  103. #endif /* USART5 */
  104. #if defined(USART6)
  105. #define LL_APB1_GRP1_PERIPH_USART6 RCC_APBENR1_USART6EN
  106. #endif /* USART6 */
  107. #define LL_APB1_GRP1_PERIPH_RTC RCC_APBENR1_RTCAPBEN
  108. #define LL_APB1_GRP1_PERIPH_WWDG RCC_APBENR1_WWDGEN
  109. #if defined(FDCAN1) || defined(FDCAN2)
  110. #define LL_APB1_GRP1_PERIPH_FDCAN RCC_APBENR1_FDCANEN
  111. #endif /* FDCAN1 */
  112. #if defined(USB_DRD_FS)
  113. #define LL_APB1_GRP1_PERIPH_USB RCC_APBENR1_USBEN
  114. #endif /* USB_DRD_FS */
  115. #define LL_APB1_GRP1_PERIPH_SPI2 RCC_APBENR1_SPI2EN
  116. #if defined(SPI3)
  117. #define LL_APB1_GRP1_PERIPH_SPI3 RCC_APBENR1_SPI3EN
  118. #endif /* SPI3 */
  119. #if defined(CRS)
  120. #define LL_APB1_GRP1_PERIPH_CRS RCC_APBENR1_CRSEN
  121. #endif /* CRS */
  122. #define LL_APB1_GRP1_PERIPH_USART2 RCC_APBENR1_USART2EN
  123. #if defined(USART3)
  124. #define LL_APB1_GRP1_PERIPH_USART3 RCC_APBENR1_USART3EN
  125. #endif /* USART3 */
  126. #if defined(USART4)
  127. #define LL_APB1_GRP1_PERIPH_USART4 RCC_APBENR1_USART4EN
  128. #endif /* USART4 */
  129. #if defined(LPUART1)
  130. #define LL_APB1_GRP1_PERIPH_LPUART1 RCC_APBENR1_LPUART1EN
  131. #endif /* LPUART1 */
  132. #define LL_APB1_GRP1_PERIPH_I2C1 RCC_APBENR1_I2C1EN
  133. #define LL_APB1_GRP1_PERIPH_I2C2 RCC_APBENR1_I2C2EN
  134. #if defined(I2C3)
  135. #define LL_APB1_GRP1_PERIPH_I2C3 RCC_APBENR1_I2C3EN
  136. #endif /* I2C3 */
  137. #if defined(CEC)
  138. #define LL_APB1_GRP1_PERIPH_CEC RCC_APBENR1_CECEN
  139. #endif /* CEC */
  140. #if defined(UCPD1)
  141. #define LL_APB1_GRP1_PERIPH_UCPD1 RCC_APBENR1_UCPD1EN
  142. #endif /* UCPD1 */
  143. #if defined(UCPD2)
  144. #define LL_APB1_GRP1_PERIPH_UCPD2 RCC_APBENR1_UCPD2EN
  145. #endif /* UCPD2 */
  146. #define LL_APB1_GRP1_PERIPH_DBGMCU RCC_APBENR1_DBGEN
  147. #define LL_APB1_GRP1_PERIPH_PWR RCC_APBENR1_PWREN
  148. #if defined(DAC1)
  149. #define LL_APB1_GRP1_PERIPH_DAC1 RCC_APBENR1_DAC1EN
  150. #endif /* DAC1 */
  151. #if defined(LPTIM2)
  152. #define LL_APB1_GRP1_PERIPH_LPTIM2 RCC_APBENR1_LPTIM2EN
  153. #endif /* LPTIM2 */
  154. #if defined(LPTIM1)
  155. #define LL_APB1_GRP1_PERIPH_LPTIM1 RCC_APBENR1_LPTIM1EN
  156. #endif /* LPTIM1 */
  157. /**
  158. * @}
  159. */
  160. /** @defgroup BUS_LL_EC_APB2_GRP1_PERIPH APB2 GRP1 PERIPH
  161. * @{
  162. */
  163. #define LL_APB2_GRP1_PERIPH_ALL 0xFFFFFFFFU
  164. #define LL_APB2_GRP1_PERIPH_SYSCFG RCC_APBENR2_SYSCFGEN
  165. #define LL_APB2_GRP1_PERIPH_TIM1 RCC_APBENR2_TIM1EN
  166. #define LL_APB2_GRP1_PERIPH_SPI1 RCC_APBENR2_SPI1EN
  167. #define LL_APB2_GRP1_PERIPH_USART1 RCC_APBENR2_USART1EN
  168. #if defined(TIM14)
  169. #define LL_APB2_GRP1_PERIPH_TIM14 RCC_APBENR2_TIM14EN
  170. #endif /* TIM14 */
  171. #if defined(TIM15)
  172. #define LL_APB2_GRP1_PERIPH_TIM15 RCC_APBENR2_TIM15EN
  173. #endif /* TIM15 */
  174. #if defined(TIM16)
  175. #define LL_APB2_GRP1_PERIPH_TIM16 RCC_APBENR2_TIM16EN
  176. #endif /* TIM16 */
  177. #if defined(TIM17)
  178. #define LL_APB2_GRP1_PERIPH_TIM17 RCC_APBENR2_TIM17EN
  179. #endif /* TIM17 */
  180. #if defined(ADC)
  181. #define LL_APB2_GRP1_PERIPH_ADC RCC_APBENR2_ADCEN
  182. #endif /* ADC */
  183. /**
  184. * @}
  185. */
  186. /** @defgroup BUS_LL_EC_IOP_GRP1_PERIPH IOP GRP1 PERIPH
  187. * @{
  188. */
  189. #define LL_IOP_GRP1_PERIPH_ALL 0xFFFFFFFFU
  190. #define LL_IOP_GRP1_PERIPH_GPIOA RCC_IOPENR_GPIOAEN
  191. #define LL_IOP_GRP1_PERIPH_GPIOB RCC_IOPENR_GPIOBEN
  192. #define LL_IOP_GRP1_PERIPH_GPIOC RCC_IOPENR_GPIOCEN
  193. #define LL_IOP_GRP1_PERIPH_GPIOD RCC_IOPENR_GPIODEN
  194. #if defined(GPIOE)
  195. #define LL_IOP_GRP1_PERIPH_GPIOE RCC_IOPENR_GPIOEEN
  196. #endif /* GPIOE */
  197. #if defined(GPIOF)
  198. #define LL_IOP_GRP1_PERIPH_GPIOF RCC_IOPENR_GPIOFEN
  199. #endif /* GPIOF */
  200. /**
  201. * @}
  202. */
  203. /**
  204. * @}
  205. */
  206. /* Exported macro ------------------------------------------------------------*/
  207. /* Exported functions --------------------------------------------------------*/
  208. /** @defgroup BUS_LL_Exported_Functions BUS Exported Functions
  209. * @{
  210. */
  211. /** @defgroup BUS_LL_EF_AHB1 AHB1
  212. * @{
  213. */
  214. /**
  215. * @brief Enable AHB1 peripherals clock.
  216. * @rmtoll AHBENR DMA1EN LL_AHB1_GRP1_EnableClock\n
  217. * AHBENR FLASHEN LL_AHB1_GRP1_EnableClock\n
  218. * AHBENR CRCEN LL_AHB1_GRP1_EnableClock\n
  219. * AHBENR AESEN LL_AHB1_GRP1_EnableClock\n
  220. * AHBENR RNGEN LL_AHB1_GRP1_EnableClock
  221. * @param Periphs This parameter can be a combination of the following values:
  222. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  223. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  224. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  225. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  226. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  227. * @note (*) RNG & CRYP Peripherals available only on STM32G081xx
  228. * @retval None
  229. */
  230. __STATIC_INLINE void LL_AHB1_GRP1_EnableClock(uint32_t Periphs)
  231. {
  232. __IO uint32_t tmpreg;
  233. SET_BIT(RCC->AHBENR, Periphs);
  234. /* Delay after an RCC peripheral clock enabling */
  235. tmpreg = READ_BIT(RCC->AHBENR, Periphs);
  236. (void)tmpreg;
  237. }
  238. /**
  239. * @brief Check if AHB1 peripheral clock is enabled or not
  240. * @rmtoll AHBENR DMA1EN LL_AHB1_GRP1_IsEnabledClock\n
  241. * AHBENR FLASHEN LL_AHB1_GRP1_IsEnabledClock\n
  242. * AHBENR CRCEN LL_AHB1_GRP1_IsEnabledClock\n
  243. * AHBENR AESEN LL_AHB1_GRP1_IsEnabledClock\n
  244. * AHBENR RNGEN LL_AHB1_GRP1_IsEnabledClock
  245. * @param Periphs This parameter can be a combination of the following values:
  246. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  247. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  248. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  249. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  250. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  251. * @note (*) RNG & CRYP Peripherals available only on STM32G081xx
  252. * @retval State of Periphs (1 or 0).
  253. */
  254. __STATIC_INLINE uint32_t LL_AHB1_GRP1_IsEnabledClock(uint32_t Periphs)
  255. {
  256. return ((READ_BIT(RCC->AHBENR, Periphs) == Periphs) ? 1UL : 0UL);
  257. }
  258. /**
  259. * @brief Disable AHB1 peripherals clock.
  260. * @rmtoll AHBENR DMA1EN LL_AHB1_GRP1_DisableClock\n
  261. * AHBENR FLASHEN LL_AHB1_GRP1_DisableClock\n
  262. * AHBENR CRCEN LL_AHB1_GRP1_DisableClock\n
  263. * AHBENR AESEN LL_AHB1_GRP1_DisableClock\n
  264. * AHBENR RNGEN LL_AHB1_GRP1_DisableClock
  265. * @param Periphs This parameter can be a combination of the following values:
  266. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  267. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  268. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  269. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  270. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  271. * @note (*) RNG & CRYP Peripherals available only on STM32G081xx
  272. * @retval None
  273. */
  274. __STATIC_INLINE void LL_AHB1_GRP1_DisableClock(uint32_t Periphs)
  275. {
  276. CLEAR_BIT(RCC->AHBENR, Periphs);
  277. }
  278. /**
  279. * @brief Force AHB1 peripherals reset.
  280. * @rmtoll AHBRSTR DMA1RST LL_AHB1_GRP1_ForceReset\n
  281. * AHBRSTR FLASHRST LL_AHB1_GRP1_ForceReset\n
  282. * AHBRSTR CRCRST LL_AHB1_GRP1_ForceReset\n
  283. * AHBRSTR AESRST LL_AHB1_GRP1_ForceReset\n
  284. * AHBRSTR RNGRST LL_AHB1_GRP1_ForceReset
  285. * @param Periphs This parameter can be a combination of the following values:
  286. * @arg @ref LL_AHB1_GRP1_PERIPH_ALL
  287. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  288. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  289. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  290. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  291. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  292. * @note (*) RNG & CRYP Peripherals available only on STM32G081xx
  293. * @retval None
  294. */
  295. __STATIC_INLINE void LL_AHB1_GRP1_ForceReset(uint32_t Periphs)
  296. {
  297. SET_BIT(RCC->AHBRSTR, Periphs);
  298. }
  299. /**
  300. * @brief Release AHB1 peripherals reset.
  301. * @rmtoll AHBRSTR DMA1RST LL_AHB1_GRP1_ReleaseReset\n
  302. * AHBRSTR FLASHRST LL_AHB1_GRP1_ReleaseReset\n
  303. * AHBRSTR CRCRST LL_AHB1_GRP1_ReleaseReset\n
  304. * AHBRSTR AESRST LL_AHB1_GRP1_ReleaseReset\n
  305. * AHBRSTR RNGRST LL_AHB1_GRP1_ReleaseReset
  306. * @param Periphs This parameter can be a combination of the following values:
  307. * @arg @ref LL_AHB1_GRP1_PERIPH_ALL
  308. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  309. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  310. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  311. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  312. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  313. * @note (*) RNG & CRYP Peripherals available only on STM32G081xx
  314. * @retval None
  315. */
  316. __STATIC_INLINE void LL_AHB1_GRP1_ReleaseReset(uint32_t Periphs)
  317. {
  318. CLEAR_BIT(RCC->AHBRSTR, Periphs);
  319. }
  320. /**
  321. * @brief Enable AHB1 peripheral clocks in Sleep and Stop modes
  322. * @rmtoll AHBSMENR DMA1SMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  323. * AHBSMENR FLASHSMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  324. * AHBSMENR SRAMSMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  325. * AHBSMENR CRCSMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  326. * AHBSMENR AESSMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  327. * AHBSMENR RNGSMEN LL_AHB1_GRP1_EnableClockStopSleep
  328. * @param Periphs This parameter can be a combination of the following values:
  329. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  330. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  331. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM
  332. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  333. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  334. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  335. * @note (*) RNG & CRYP Peripherals available only on STM32G081xx
  336. * @retval None
  337. */
  338. __STATIC_INLINE void LL_AHB1_GRP1_EnableClockStopSleep(uint32_t Periphs)
  339. {
  340. __IO uint32_t tmpreg;
  341. SET_BIT(RCC->AHBSMENR, Periphs);
  342. /* Delay after an RCC peripheral clock enabling */
  343. tmpreg = READ_BIT(RCC->AHBSMENR, Periphs);
  344. (void)tmpreg;
  345. }
  346. /**
  347. * @brief Disable AHB1 peripheral clocks in Sleep and Stop modes
  348. * @rmtoll AHBSMENR DMA1SMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  349. * AHBSMENR FLASHSMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  350. * AHBSMENR SRAMSMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  351. * AHBSMENR CRCSMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  352. * AHBSMENR AESSMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  353. * AHBSMENR RNGSMEN LL_AHB1_GRP1_DisableClockStopSleep
  354. * @param Periphs This parameter can be a combination of the following values:
  355. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  356. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  357. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM
  358. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  359. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  360. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  361. * @note (*) RNG & CRYP Peripherals available only on STM32G081xx
  362. * @retval None
  363. */
  364. __STATIC_INLINE void LL_AHB1_GRP1_DisableClockStopSleep(uint32_t Periphs)
  365. {
  366. CLEAR_BIT(RCC->AHBSMENR, Periphs);
  367. }
  368. /**
  369. * @}
  370. */
  371. /** @defgroup BUS_LL_EF_APB1 APB1
  372. * @{
  373. */
  374. /**
  375. * @brief Enable APB1 peripherals clock.
  376. * @rmtoll APBENR1 TIM2EN LL_APB1_GRP1_EnableClock\n
  377. * APBENR1 TIM3EN LL_APB1_GRP1_EnableClock\n
  378. * APBENR1 TIM4EN LL_APB1_GRP1_EnableClock\n
  379. * APBENR1 TIM6EN LL_APB1_GRP1_EnableClock\n
  380. * APBENR1 TIM7EN LL_APB1_GRP1_EnableClock\n
  381. * APBENR1 RTCAPBEN LL_APB1_GRP1_EnableClock\n
  382. * APBENR1 WWDGEN LL_APB1_GRP1_EnableClock\n
  383. * APBENR1 SPI2EN LL_APB1_GRP1_EnableClock\n
  384. * APBENR1 SPI3EN LL_APB1_GRP1_EnableClock\n
  385. * APBENR1 USART2EN LL_APB1_GRP1_EnableClock\n
  386. * APBENR1 USART3EN LL_APB1_GRP1_EnableClock\n
  387. * APBENR1 USART4EN LL_APB1_GRP1_EnableClock\n
  388. * APBENR1 USART5EN LL_APB1_GRP1_EnableClock\n
  389. * APBENR1 USART6EN LL_APB1_GRP1_EnableClock\n
  390. * APBENR1 LPUART1EN LL_APB1_GRP1_EnableClock\n
  391. * APBENR1 LPUART2EN LL_APB1_GRP1_EnableClock\n
  392. * APBENR1 I2C1EN LL_APB1_GRP1_EnableClock\n
  393. * APBENR1 I2C2EN LL_APB1_GRP1_EnableClock\n
  394. * APBENR1 I2C3EN LL_APB1_GRP1_EnableClock\n
  395. * APBENR1 CECEN LL_APB1_GRP1_EnableClock\n
  396. * APBENR1 UCPD1EN LL_APB1_GRP1_EnableClock\n
  397. * APBENR1 UCPD2EN LL_APB1_GRP1_EnableClock\n
  398. * APBENR1 USBEN LL_APB1_GRP1_EnableClock\n
  399. * APBENR1 FDCANEN LL_APB1_GRP1_EnableClock\n
  400. * APBENR1 DBGEN LL_APB1_GRP1_EnableClock\n
  401. * APBENR1 PWREN LL_APB1_GRP1_EnableClock\n
  402. * APBENR1 DAC1EN LL_APB1_GRP1_EnableClock\n
  403. * APBENR1 LPTIM2EN LL_APB1_GRP1_EnableClock\n
  404. * APBENR1 LPTIM1EN LL_APB1_GRP1_EnableClock
  405. * @param Periphs This parameter can be a combination of the following values:
  406. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (1)
  407. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  408. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (1)
  409. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (1)
  410. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (1)
  411. * @arg @ref LL_APB1_GRP1_PERIPH_RTC
  412. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  413. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2
  414. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (1)
  415. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  416. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (1)
  417. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (1)
  418. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (1)
  419. * @arg @ref LL_APB1_GRP1_PERIPH_USART6 (1)
  420. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1 (1)
  421. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART2 (1)
  422. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  423. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2
  424. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (1)
  425. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (1)
  426. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD1 (1)
  427. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD2 (1)
  428. * @arg @ref LL_APB1_GRP1_PERIPH_USB (1)
  429. * @arg @ref LL_APB1_GRP1_PERIPH_FDCAN (1)
  430. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  431. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  432. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (1)
  433. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM2 (1)
  434. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1 (1)
  435. * @note Peripheral marked with (1) are not available all devices
  436. * @retval None
  437. */
  438. __STATIC_INLINE void LL_APB1_GRP1_EnableClock(uint32_t Periphs)
  439. {
  440. __IO uint32_t tmpreg;
  441. SET_BIT(RCC->APBENR1, Periphs);
  442. /* Delay after an RCC peripheral clock enabling */
  443. tmpreg = READ_BIT(RCC->APBENR1, Periphs);
  444. (void)tmpreg;
  445. }
  446. /**
  447. * @brief Check if APB1 peripheral clock is enabled or not
  448. * @rmtoll APBENR1 TIM2EN LL_APB1_GRP1_IsEnabledClock\n
  449. * APBENR1 TIM3EN LL_APB1_GRP1_IsEnabledClock\n
  450. * APBENR1 TIM4EN LL_APB1_GRP1_IsEnabledClock\n
  451. * APBENR1 TIM6EN LL_APB1_GRP1_IsEnabledClock\n
  452. * APBENR1 TIM7EN LL_APB1_GRP1_IsEnabledClock\n
  453. * APBENR1 RTCAPBEN LL_APB1_GRP1_IsEnabledClock\n
  454. * APBENR1 WWDGEN LL_APB1_GRP1_IsEnabledClock\n
  455. * APBENR1 SPI2EN LL_APB1_GRP1_IsEnabledClock\n
  456. * APBENR1 SPI3EN LL_APB1_GRP1_IsEnabledClock\n
  457. * APBENR1 USART2EN LL_APB1_GRP1_IsEnabledClock\n
  458. * APBENR1 USART3EN LL_APB1_GRP1_IsEnabledClock\n
  459. * APBENR1 USART4EN LL_APB1_GRP1_IsEnabledClock\n
  460. * APBENR1 USART5EN LL_APB1_GRP1_IsEnabledClock\n
  461. * APBENR1 USART6EN LL_APB1_GRP1_IsEnabledClock\n
  462. * APBENR1 LPUART1EN LL_APB1_GRP1_IsEnabledClock\n
  463. * APBENR1 LPUART2EN LL_APB1_GRP1_IsEnabledClock\n
  464. * APBENR1 I2C1EN LL_APB1_GRP1_IsEnabledClock\n
  465. * APBENR1 I2C2EN LL_APB1_GRP1_IsEnabledClock\n
  466. * APBENR1 I2C3EN LL_APB1_GRP1_IsEnabledClock\n
  467. * APBENR1 CECEN LL_APB1_GRP1_IsEnabledClock\n
  468. * APBENR1 UCPD1EN LL_APB1_GRP1_IsEnabledClock\n
  469. * APBENR1 UCPD2EN LL_APB1_GRP1_IsEnabledClock\n
  470. * APBENR1 USBEN LL_APB1_GRP1_IsEnabledClock\n
  471. * APBENR1 FDCANEN LL_APB1_GRP1_IsEnabledClock\n
  472. * APBENR1 DBGEN LL_APB1_GRP1_IsEnabledClock\n
  473. * APBENR1 PWREN LL_APB1_GRP1_IsEnabledClock\n
  474. * APBENR1 DAC1EN LL_APB1_GRP1_IsEnabledClock\n
  475. * APBENR1 LPTIM2EN LL_APB1_GRP1_IsEnabledClock\n
  476. * APBENR1 LPTIM1EN LL_APB1_GRP1_IsEnabledClock
  477. * @param Periphs This parameter can be a combination of the following values:
  478. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (1)
  479. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  480. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (1)
  481. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (1)
  482. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (1)
  483. * @arg @ref LL_APB1_GRP1_PERIPH_RTC
  484. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  485. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2
  486. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (1)
  487. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  488. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (1)
  489. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (1)
  490. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (1)
  491. * @arg @ref LL_APB1_GRP1_PERIPH_USART6 (1)
  492. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1 (1)
  493. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART2 (1)
  494. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  495. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2
  496. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (1)
  497. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (1)
  498. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD1 (1)
  499. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD2 (1)
  500. * @arg @ref LL_APB1_GRP1_PERIPH_USB (1)
  501. * @arg @ref LL_APB1_GRP1_PERIPH_FDCAN (1)
  502. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  503. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  504. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (1)
  505. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM2 (1)
  506. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1 (1)
  507. * @note Peripheral marked with (1) are not available all devices
  508. * @retval State of Periphs (1 or 0).
  509. */
  510. __STATIC_INLINE uint32_t LL_APB1_GRP1_IsEnabledClock(uint32_t Periphs)
  511. {
  512. return ((READ_BIT(RCC->APBENR1, Periphs) == (Periphs)) ? 1UL : 0UL);
  513. }
  514. /**
  515. * @brief Disable APB1 peripherals clock.
  516. * @rmtoll APBENR1 TIM2EN LL_APB1_GRP1_DisableClock\n
  517. * APBENR1 TIM3EN LL_APB1_GRP1_DisableClock\n
  518. * APBENR1 TIM4EN LL_APB1_GRP1_DisableClock\n
  519. * APBENR1 TIM6EN LL_APB1_GRP1_DisableClock\n
  520. * APBENR1 TIM7EN LL_APB1_GRP1_DisableClock\n
  521. * APBENR1 RTCAPBEN LL_APB1_GRP1_DisableClock\n
  522. * APBENR1 WWDGEN LL_APB1_GRP1_DisableClock\n
  523. * APBENR1 SPI2EN LL_APB1_GRP1_DisableClock\n
  524. * APBENR1 SPI3EN LL_APB1_GRP1_DisableClock\n
  525. * APBENR1 USART2EN LL_APB1_GRP1_DisableClock\n
  526. * APBENR1 USART3EN LL_APB1_GRP1_DisableClock\n
  527. * APBENR1 USART4EN LL_APB1_GRP1_DisableClock\n
  528. * APBENR1 USART5EN LL_APB1_GRP1_DisableClock\n
  529. * APBENR1 USART6EN LL_APB1_GRP1_DisableClock\n
  530. * APBENR1 LPUART1EN LL_APB1_GRP1_DisableClock\n
  531. * APBENR1 LPUART2EN LL_APB1_GRP1_DisableClock\n
  532. * APBENR1 I2C1EN LL_APB1_GRP1_DisableClock\n
  533. * APBENR1 I2C2EN LL_APB1_GRP1_DisableClock\n
  534. * APBENR1 I2C3EN LL_APB1_GRP1_DisableClock\n
  535. * APBENR1 CECEN LL_APB1_GRP1_DisableClock\n
  536. * APBENR1 UCPD1EN LL_APB1_GRP1_DisableClock\n
  537. * APBENR1 UCPD2EN LL_APB1_GRP1_DisableClock\n
  538. * APBENR1 USBEN LL_APB1_GRP1_DisableClock\n
  539. * APBENR1 FDCANEN LL_APB1_GRP1_DisableClock\n
  540. * APBENR1 DBGEN LL_APB1_GRP1_DisableClock\n
  541. * APBENR1 PWREN LL_APB1_GRP1_DisableClock\n
  542. * APBENR1 DAC1EN LL_APB1_GRP1_DisableClock\n
  543. * APBENR1 LPTIM2EN LL_APB1_GRP1_DisableClock\n
  544. * APBENR1 LPTIM1EN LL_APB1_GRP1_DisableClock
  545. * @param Periphs This parameter can be a combination of the following values:
  546. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (1)
  547. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  548. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (1)
  549. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (1)
  550. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (1)
  551. * @arg @ref LL_APB1_GRP1_PERIPH_RTC
  552. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  553. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2
  554. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (1)
  555. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  556. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (1)
  557. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (1)
  558. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (1)
  559. * @arg @ref LL_APB1_GRP1_PERIPH_USART6 (1)
  560. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1 (1)
  561. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART2 (1)
  562. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  563. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2
  564. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (1)
  565. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (1)
  566. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD1 (1)
  567. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD2 (1)
  568. * @arg @ref LL_APB1_GRP1_PERIPH_USB (1)
  569. * @arg @ref LL_APB1_GRP1_PERIPH_FDCAN (1)
  570. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  571. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  572. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (1)
  573. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM2 (1)
  574. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1 (1)
  575. * @note Peripheral marked with (1) are not available all devices
  576. * @retval None
  577. */
  578. __STATIC_INLINE void LL_APB1_GRP1_DisableClock(uint32_t Periphs)
  579. {
  580. CLEAR_BIT(RCC->APBENR1, Periphs);
  581. }
  582. /**
  583. * @brief Force APB1 peripherals reset.
  584. * @rmtoll APBRSTR1 TIM2RST LL_APB1_GRP1_ForceReset\n
  585. * APBRSTR1 TIM3RST LL_APB1_GRP1_ForceReset\n
  586. * APBRSTR1 TIM4RST LL_APB1_GRP1_ForceReset\n
  587. * APBRSTR1 TIM6RST LL_APB1_GRP1_ForceReset\n
  588. * APBRSTR1 TIM7RST LL_APB1_GRP1_ForceReset\n
  589. * APBRSTR1 RTCRST LL_APB1_GRP1_ForceReset\n
  590. * APBRSTR1 WWDGRST LL_APB1_GRP1_ForceReset\n
  591. * APBRSTR1 SPI2RST LL_APB1_GRP1_ForceReset\n
  592. * APBRSTR1 SPI3RST LL_APB1_GRP1_ForceReset\n
  593. * APBRSTR1 USART2RST LL_APB1_GRP1_ForceReset\n
  594. * APBRSTR1 USART3RST LL_APB1_GRP1_ForceReset\n
  595. * APBRSTR1 USART4RST LL_APB1_GRP1_ForceReset\n
  596. * APBRSTR1 USART5RST LL_APB1_GRP1_ForceReset\n
  597. * APBRSTR1 USART6RST LL_APB1_GRP1_ForceReset\n
  598. * APBRSTR1 LPUART1RST LL_APB1_GRP1_ForceReset\n
  599. * APBRSTR1 LPUART2RST LL_APB1_GRP1_ForceReset\n
  600. * APBRSTR1 I2C1RST LL_APB1_GRP1_ForceReset\n
  601. * APBRSTR1 I2C2RST LL_APB1_GRP1_ForceReset\n
  602. * APBRSTR1 I2C3RST LL_APB1_GRP1_ForceReset\n
  603. * APBRSTR1 CECRST LL_APB1_GRP1_ForceReset\n
  604. * APBRSTR1 UCPD1RST LL_APB1_GRP1_ForceReset\n
  605. * APBRSTR1 UCPD2RST LL_APB1_GRP1_ForceReset\n
  606. * APBRSTR1 USBRST LL_APB1_GRP1_ForceReset\n
  607. * APBRSTR1 FDCANRST LL_APB1_GRP1_ForceReset\n
  608. * APBRSTR1 DBGRST LL_APB1_GRP1_ForceReset\n
  609. * APBRSTR1 PWRRST LL_APB1_GRP1_ForceReset\n
  610. * APBRSTR1 DAC1RST LL_APB1_GRP1_ForceReset\n
  611. * APBRSTR1 LPTIM2RST LL_APB1_GRP1_ForceReset\n
  612. * APBRSTR1 LPTIM1RST LL_APB1_GRP1_ForceReset
  613. * @param Periphs This parameter can be a combination of the following values:
  614. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (1)
  615. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  616. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (1)
  617. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (1)
  618. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (1)
  619. * @arg @ref LL_APB1_GRP1_PERIPH_RTC
  620. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  621. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2
  622. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (1)
  623. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  624. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (1)
  625. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (1)
  626. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (1)
  627. * @arg @ref LL_APB1_GRP1_PERIPH_USART6 (1)
  628. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1 (1)
  629. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART2 (1)
  630. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  631. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2
  632. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (1)
  633. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (1)
  634. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD1 (1)
  635. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD2 (1)
  636. * @arg @ref LL_APB1_GRP1_PERIPH_USB (1)
  637. * @arg @ref LL_APB1_GRP1_PERIPH_FDCAN (1)
  638. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  639. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  640. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (1)
  641. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM2 (1)
  642. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1 (1)
  643. * @note Peripheral marked with (1) are not available all devices
  644. * @retval None
  645. */
  646. __STATIC_INLINE void LL_APB1_GRP1_ForceReset(uint32_t Periphs)
  647. {
  648. SET_BIT(RCC->APBRSTR1, Periphs);
  649. }
  650. /**
  651. * @brief Release APB1 peripherals reset.
  652. * @rmtoll APBRSTR1 TIM2RST LL_APB1_GRP1_ReleaseReset\n
  653. * APBRSTR1 TIM4RST LL_APB1_GRP1_ReleaseReset\n
  654. * APBRSTR1 TIM6RST LL_APB1_GRP1_ReleaseReset\n
  655. * APBRSTR1 TIM7RST LL_APB1_GRP1_ReleaseReset\n
  656. * APBRSTR1 RTCRST LL_APB1_GRP1_ReleaseReset\n
  657. * APBRSTR1 WWDGRST LL_APB1_GRP1_ReleaseReset\n
  658. * APBRSTR1 SPI2RST LL_APB1_GRP1_ReleaseReset\n
  659. * APBRSTR1 SPI3RST LL_APB1_GRP1_ReleaseReset\n
  660. * APBRSTR1 USART2RST LL_APB1_GRP1_ReleaseReset\n
  661. * APBRSTR1 USART3RST LL_APB1_GRP1_ReleaseReset\n
  662. * APBRSTR1 USART4RST LL_APB1_GRP1_ReleaseReset\n
  663. * APBRSTR1 USART5RST LL_APB1_GRP1_ReleaseReset\n
  664. * APBRSTR1 USART6RST LL_APB1_GRP1_ReleaseReset\n
  665. * APBRSTR1 LPUART1RST LL_APB1_GRP1_ReleaseReset\n
  666. * APBRSTR1 LPUART2RST LL_APB1_GRP1_ReleaseReset\n
  667. * APBRSTR1 I2C1RST LL_APB1_GRP1_ReleaseReset\n
  668. * APBRSTR1 I2C2RST LL_APB1_GRP1_ReleaseReset\n
  669. * APBRSTR1 I2C3RST LL_APB1_GRP1_ReleaseReset\n
  670. * APBRSTR1 CECRST LL_APB1_GRP1_ReleaseReset\n
  671. * APBRSTR1 UCPD1RST LL_APB1_GRP1_ReleaseReset\n
  672. * APBRSTR1 UCPD2RST LL_APB1_GRP1_ReleaseReset\n
  673. * APBRSTR1 USBRST LL_APB1_GRP1_ReleaseReset\n
  674. * APBRSTR1 FDCANRST LL_APB1_GRP1_ReleaseReset\n
  675. * APBRSTR1 DBGRST LL_APB1_GRP1_ReleaseReset\n
  676. * APBRSTR1 PWRRST LL_APB1_GRP1_ReleaseReset\n
  677. * APBRSTR1 DAC1RST LL_APB1_GRP1_ReleaseReset\n
  678. * APBRSTR1 LPTIM2RST LL_APB1_GRP1_ReleaseReset\n
  679. * APBRSTR1 LPTIM1RST LL_APB1_GRP1_ReleaseReset
  680. * @param Periphs This parameter can be a combination of the following values:
  681. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (1)
  682. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  683. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (1)
  684. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (1)
  685. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (1)
  686. * @arg @ref LL_APB1_GRP1_PERIPH_RTC
  687. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  688. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2
  689. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (1)
  690. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  691. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (1)
  692. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (1)
  693. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (1)
  694. * @arg @ref LL_APB1_GRP1_PERIPH_USART6 (1)
  695. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1 (1)
  696. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART2 (1)
  697. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  698. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2
  699. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (1)
  700. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (1)
  701. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD1 (1)
  702. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD2 (1)
  703. * @arg @ref LL_APB1_GRP1_PERIPH_USB (1)
  704. * @arg @ref LL_APB1_GRP1_PERIPH_FDCAN (1)
  705. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  706. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  707. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (1)
  708. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM2 (1)
  709. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1 (1)
  710. * @note Peripheral marked with (1) are not available all devices
  711. * @retval None
  712. */
  713. __STATIC_INLINE void LL_APB1_GRP1_ReleaseReset(uint32_t Periphs)
  714. {
  715. CLEAR_BIT(RCC->APBRSTR1, Periphs);
  716. }
  717. /**
  718. * @brief Enable APB1 peripheral clocks in Sleep and Stop modes
  719. * @rmtoll APBSMENR1 TIM2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  720. * APBSMENR1 TIM3SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  721. * APBSMENR1 TIM4SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  722. * APBSMENR1 TIM6SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  723. * APBSMENR1 TIM7SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  724. * APBSMENR1 RTCAPBSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  725. * APBSMENR1 WWDGSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  726. * APBSMENR1 SPI2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  727. * APBSMENR1 SPI3SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  728. * APBSMENR1 USART2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  729. * APBSMENR1 USART3SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  730. * APBSMENR1 USART4SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  731. * APBSMENR1 USART5SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  732. * APBSMENR1 USART6SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  733. * APBSMENR1 LPUART1SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  734. * APBSMENR1 LPUART2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  735. * APBSMENR1 I2C1SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  736. * APBSMENR1 I2C2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  737. * APBSMENR1 I2C3SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  738. * APBSMENR1 CECSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  739. * APBSMENR1 UCPD1SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  740. * APBSMENR1 UCPD2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  741. * APBSMENR1 USBSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  742. * APBSMENR1 FDCANSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  743. * APBSMENR1 DBGSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  744. * APBSMENR1 PWRSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  745. * APBSMENR1 DAC1SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  746. * APBSMENR1 LPTIM2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  747. * APBSMENR1 LPTIM1SMEN LL_APB1_GRP1_EnableClockStopSleep
  748. * @param Periphs This parameter can be a combination of the following values:
  749. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (1)
  750. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  751. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (1)
  752. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (1)
  753. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (1)
  754. * @arg @ref LL_APB1_GRP1_PERIPH_RTC
  755. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  756. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2
  757. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (1)
  758. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  759. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (1)
  760. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (1)
  761. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (1)
  762. * @arg @ref LL_APB1_GRP1_PERIPH_USART6 (1)
  763. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1 (1)
  764. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART2 (1)
  765. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  766. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2
  767. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (1)
  768. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (1)
  769. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD1 (1)
  770. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD2 (1)
  771. * @arg @ref LL_APB1_GRP1_PERIPH_USB (1)
  772. * @arg @ref LL_APB1_GRP1_PERIPH_FDCAN (1)
  773. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  774. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  775. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (1)
  776. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM2 (1)
  777. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1 (1)
  778. * @note Peripheral marked with (1) are not available all devices
  779. * @retval None
  780. */
  781. __STATIC_INLINE void LL_APB1_GRP1_EnableClockStopSleep(uint32_t Periphs)
  782. {
  783. __IO uint32_t tmpreg;
  784. SET_BIT(RCC->APBSMENR1, Periphs);
  785. /* Delay after an RCC peripheral clock enabling */
  786. tmpreg = READ_BIT(RCC->APBSMENR1, Periphs);
  787. (void)tmpreg;
  788. }
  789. /**
  790. * @brief Disable APB1 peripheral clocks in Sleep and Stop modes
  791. * @rmtoll APBSMENR1 TIM2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  792. * APBSMENR1 TIM3SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  793. * APBSMENR1 TIM'SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  794. * APBSMENR1 TIM6SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  795. * APBSMENR1 TIM7SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  796. * APBSMENR1 RTCAPBSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  797. * APBSMENR1 WWDGSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  798. * APBSMENR1 SPI2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  799. * APBSMENR1 SPI3SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  800. * APBSMENR1 USART2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  801. * APBSMENR1 USART3SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  802. * APBSMENR1 USART4SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  803. * APBSMENR1 USART5SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  804. * APBSMENR1 USART6SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  805. * APBSMENR1 LPUART1SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  806. * APBSMENR1 LPUART2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  807. * APBSMENR1 I2C1SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  808. * APBSMENR1 I2C2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  809. * APBSMENR1 I2C3SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  810. * APBSMENR1 CECSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  811. * APBSMENR1 UCPD1SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  812. * APBSMENR1 UCPD2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  813. * APBSMENR1 USBSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  814. * APBSMENR1 FSCANSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  815. * APBSMENR1 DBGSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  816. * APBSMENR1 PWRSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  817. * APBSMENR1 DAC1SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  818. * APBSMENR1 LPTIM2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  819. * APBSMENR1 LPTIM1SMEN LL_APB1_GRP1_DisableClockStopSleep
  820. * @param Periphs This parameter can be a combination of the following values:
  821. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 (1)
  822. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3
  823. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (1)
  824. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (1)
  825. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (1)
  826. * @arg @ref LL_APB1_GRP1_PERIPH_RTC
  827. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  828. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2
  829. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (1)
  830. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  831. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (1)
  832. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (1)
  833. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (1)
  834. * @arg @ref LL_APB1_GRP1_PERIPH_USART6 (1)
  835. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1 (1)
  836. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART2 (1)
  837. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  838. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2
  839. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (1)
  840. * @arg @ref LL_APB1_GRP1_PERIPH_CEC (1)
  841. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD1 (1)
  842. * @arg @ref LL_APB1_GRP1_PERIPH_UCPD2 (1)
  843. * @arg @ref LL_APB1_GRP1_PERIPH_USB (1)
  844. * @arg @ref LL_APB1_GRP1_PERIPH_FDCAN (1)
  845. * @arg @ref LL_APB1_GRP1_PERIPH_DBGMCU
  846. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  847. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (1)
  848. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM2 (1)
  849. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1 (1)
  850. * @note Peripheral marked with (1) are not available all devices
  851. * @retval None
  852. */
  853. __STATIC_INLINE void LL_APB1_GRP1_DisableClockStopSleep(uint32_t Periphs)
  854. {
  855. CLEAR_BIT(RCC->APBSMENR1, Periphs);
  856. }
  857. /**
  858. * @}
  859. */
  860. /** @defgroup BUS_LL_EF_APB2 APB2
  861. * @{
  862. */
  863. /**
  864. * @brief Enable APB2 peripherals clock.
  865. * @rmtoll APBENR2 SYSCFGEN LL_APB2_GRP1_EnableClock\n
  866. * APBENR2 TIM1EN LL_APB2_GRP1_EnableClock\n
  867. * APBENR2 SPI1EN LL_APB2_GRP1_EnableClock\n
  868. * APBENR2 USART1EN LL_APB2_GRP1_EnableClock\n
  869. * APBENR2 TIM14EN LL_APB2_GRP1_EnableClock\n
  870. * APBENR2 TIM15EN LL_APB2_GRP1_EnableClock\n
  871. * APBENR2 TIM16EN LL_APB2_GRP1_EnableClock\n
  872. * APBENR2 TIM17EN LL_APB2_GRP1_EnableClock\n
  873. * APBENR2 ADCEN LL_APB2_GRP1_EnableClock
  874. * @param Periphs This parameter can be a combination of the following values:
  875. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  876. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  877. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  878. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  879. * @arg @ref LL_APB2_GRP1_PERIPH_TIM14
  880. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)
  881. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  882. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17
  883. * @arg @ref LL_APB2_GRP1_PERIPH_ADC
  884. * @note (*) peripheral not available on all devices
  885. * @retval None
  886. */
  887. __STATIC_INLINE void LL_APB2_GRP1_EnableClock(uint32_t Periphs)
  888. {
  889. __IO uint32_t tmpreg;
  890. SET_BIT(RCC->APBENR2, Periphs);
  891. /* Delay after an RCC peripheral clock enabling */
  892. tmpreg = READ_BIT(RCC->APBENR2, Periphs);
  893. (void)tmpreg;
  894. }
  895. /**
  896. * @brief Check if APB2 peripheral clock is enabled or not
  897. * @rmtoll APBENR2 SYSCFGEN LL_APB2_GRP1_IsEnabledClock\n
  898. * APBENR2 TIM1EN LL_APB2_GRP1_IsEnabledClock\n
  899. * APBENR2 SPI1EN LL_APB2_GRP1_IsEnabledClock\n
  900. * APBENR2 USART1EN LL_APB2_GRP1_IsEnabledClock\n
  901. * APBENR2 TIM14EN LL_APB2_GRP1_IsEnabledClock\n
  902. * APBENR2 TIM15EN LL_APB2_GRP1_IsEnabledClock\n
  903. * APBENR2 TIM16EN LL_APB2_GRP1_IsEnabledClock\n
  904. * APBENR2 TIM17EN LL_APB2_GRP1_IsEnabledClock\n
  905. * APBENR2 ADCEN LL_APB2_GRP1_IsEnabledClock
  906. * @param Periphs This parameter can be a combination of the following values:
  907. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  908. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  909. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  910. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  911. * @arg @ref LL_APB2_GRP1_PERIPH_TIM14
  912. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)
  913. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  914. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17
  915. * @arg @ref LL_APB2_GRP1_PERIPH_ADC
  916. * @note (*) peripheral not available on all devices
  917. * @retval State of Periphs (1 or 0).
  918. */
  919. __STATIC_INLINE uint32_t LL_APB2_GRP1_IsEnabledClock(uint32_t Periphs)
  920. {
  921. return ((READ_BIT(RCC->APBENR2, Periphs) == (Periphs)) ? 1UL : 0UL);
  922. }
  923. /**
  924. * @brief Disable APB2 peripherals clock.
  925. * @rmtoll APBENR2 SYSCFGEN LL_APB2_GRP1_DisableClock\n
  926. * APBENR2 TIM1EN LL_APB2_GRP1_DisableClock\n
  927. * APBENR2 SPI1EN LL_APB2_GRP1_DisableClock\n
  928. * APBENR2 USART1EN LL_APB2_GRP1_DisableClock\n
  929. * APBENR2 TIM14EN LL_APB2_GRP1_DisableClock\n
  930. * APBENR2 TIM15EN LL_APB2_GRP1_DisableClock\n
  931. * APBENR2 TIM16EN LL_APB2_GRP1_DisableClock\n
  932. * APBENR2 TIM17EN LL_APB2_GRP1_DisableClock\n
  933. * APBENR2 ADCEN LL_APB2_GRP1_DisableClock
  934. * @param Periphs This parameter can be a combination of the following values:
  935. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  936. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  937. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  938. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  939. * @arg @ref LL_APB2_GRP1_PERIPH_TIM14
  940. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)
  941. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  942. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17
  943. * @arg @ref LL_APB2_GRP1_PERIPH_ADC
  944. * @note (*) peripheral not available on all devices
  945. * @retval None
  946. */
  947. __STATIC_INLINE void LL_APB2_GRP1_DisableClock(uint32_t Periphs)
  948. {
  949. CLEAR_BIT(RCC->APBENR2, Periphs);
  950. }
  951. /**
  952. * @brief Force APB2 peripherals reset.
  953. * @rmtoll APBRSTR2 SYSCFGRST LL_APB2_GRP1_ForceReset\n
  954. * APBRSTR2 TIM1RST LL_APB2_GRP1_ForceReset\n
  955. * APBRSTR2 SPI1RST LL_APB2_GRP1_ForceReset\n
  956. * APBRSTR2 USART1RST LL_APB2_GRP1_ForceReset\n
  957. * APBRSTR2 TIM14RST LL_APB2_GRP1_ForceReset\n
  958. * APBRSTR2 TIM15RST LL_APB2_GRP1_ForceReset\n
  959. * APBRSTR2 TIM16RST LL_APB2_GRP1_ForceReset\n
  960. * APBRSTR2 TIM17RST LL_APB2_GRP1_ForceReset\n
  961. * APBRSTR2 ADCRST LL_APB2_GRP1_ForceReset
  962. * @param Periphs This parameter can be a combination of the following values:
  963. * @arg @ref LL_APB2_GRP1_PERIPH_ALL
  964. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  965. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  966. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  967. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  968. * @arg @ref LL_APB2_GRP1_PERIPH_TIM14
  969. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)
  970. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  971. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17
  972. * @arg @ref LL_APB2_GRP1_PERIPH_ADC
  973. * @note (*) peripheral not available on all devices
  974. * @retval None
  975. */
  976. __STATIC_INLINE void LL_APB2_GRP1_ForceReset(uint32_t Periphs)
  977. {
  978. SET_BIT(RCC->APBRSTR2, Periphs);
  979. }
  980. /**
  981. * @brief Release APB2 peripherals reset.
  982. * @rmtoll APBRSTR2 SYSCFGRST LL_APB2_GRP1_ReleaseReset\n
  983. * APBRSTR2 TIM1RST LL_APB2_GRP1_ReleaseReset\n
  984. * APBRSTR2 SPI1RST LL_APB2_GRP1_ReleaseReset\n
  985. * APBRSTR2 USART1RST LL_APB2_GRP1_ReleaseReset\n
  986. * APBRSTR2 TIM14RST LL_APB2_GRP1_ReleaseReset\n
  987. * APBRSTR2 TIM15RST LL_APB2_GRP1_ReleaseReset\n
  988. * APBRSTR2 TIM16RST LL_APB2_GRP1_ReleaseReset\n
  989. * APBRSTR2 TIM17RST LL_APB2_GRP1_ReleaseReset\n
  990. * APBRSTR2 ADCRST LL_APB2_GRP1_ReleaseReset
  991. * @param Periphs This parameter can be a combination of the following values:
  992. * @arg @ref LL_APB2_GRP1_PERIPH_ALL
  993. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  994. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  995. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  996. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  997. * @arg @ref LL_APB2_GRP1_PERIPH_TIM14
  998. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)
  999. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  1000. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17
  1001. * @arg @ref LL_APB2_GRP1_PERIPH_ADC
  1002. * @note (*) peripheral not available on all devices
  1003. * @retval None
  1004. */
  1005. __STATIC_INLINE void LL_APB2_GRP1_ReleaseReset(uint32_t Periphs)
  1006. {
  1007. CLEAR_BIT(RCC->APBRSTR2, Periphs);
  1008. }
  1009. /**
  1010. * @brief Enable APB2 peripheral clocks in Sleep and Stop modes
  1011. * @rmtoll APBSMENR2 SYSCFGSMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1012. * APBSMENR2 TIM1SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1013. * APBSMENR2 SPI1SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1014. * APBSMENR2 USART1SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1015. * APBSMENR2 TIM14SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1016. * APBSMENR2 TIM15SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1017. * APBSMENR2 TIM16SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1018. * APBSMENR2 TIM17SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1019. * APBSMENR2 ADCSMEN LL_APB2_GRP1_EnableClockStopSleep
  1020. * @param Periphs This parameter can be a combination of the following values:
  1021. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  1022. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  1023. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  1024. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  1025. * @arg @ref LL_APB2_GRP1_PERIPH_TIM14
  1026. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)
  1027. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  1028. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17
  1029. * @arg @ref LL_APB2_GRP1_PERIPH_ADC
  1030. * @note (*) peripheral not available on all devices
  1031. * @retval None
  1032. */
  1033. __STATIC_INLINE void LL_APB2_GRP1_EnableClockStopSleep(uint32_t Periphs)
  1034. {
  1035. __IO uint32_t tmpreg;
  1036. SET_BIT(RCC->APBSMENR2, Periphs);
  1037. /* Delay after an RCC peripheral clock enabling */
  1038. tmpreg = READ_BIT(RCC->APBSMENR2, Periphs);
  1039. (void)tmpreg;
  1040. }
  1041. /**
  1042. * @brief Disable APB2 peripheral clocks in Sleep and Stop modes
  1043. * @rmtoll APBSMENR2 SYSCFGSMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1044. * APBSMENR2 TIM1SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1045. * APBSMENR2 SPI1SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1046. * APBSMENR2 USART1SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1047. * APBSMENR2 TIM14SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1048. * APBSMENR2 TIM15SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1049. * APBSMENR2 TIM16SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1050. * APBSMENR2 TIM17SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1051. * APBSMENR2 ADCSMEN LL_APB2_GRP1_DisableClockStopSleep
  1052. * @param Periphs This parameter can be a combination of the following values:
  1053. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  1054. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  1055. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  1056. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  1057. * @arg @ref LL_APB2_GRP1_PERIPH_TIM14
  1058. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)
  1059. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  1060. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17
  1061. * @arg @ref LL_APB2_GRP1_PERIPH_ADC
  1062. * @note (*) peripheral not available on all devices
  1063. * @retval None
  1064. */
  1065. __STATIC_INLINE void LL_APB2_GRP1_DisableClockStopSleep(uint32_t Periphs)
  1066. {
  1067. CLEAR_BIT(RCC->APBSMENR2, Periphs);
  1068. }
  1069. /**
  1070. * @}
  1071. */
  1072. /** @defgroup BUS_LL_EF_IOP IOP
  1073. * @{
  1074. */
  1075. /**
  1076. * @brief Enable IOP peripherals clock.
  1077. * @rmtoll IOPENR GPIOAEN LL_IOP_GRP1_EnableClock\n
  1078. * IOPENR GPIOBEN LL_IOP_GRP1_EnableClock\n
  1079. * IOPENR GPIOCEN LL_IOP_GRP1_EnableClock\n
  1080. * IOPENR GPIODEN LL_IOP_GRP1_EnableClock\n
  1081. * IOPENR GPIOEEN LL_IOP_GRP1_EnableClock\n
  1082. * IOPENR GPIOFEN LL_IOP_GRP1_EnableClock
  1083. * @param Periphs This parameter can be a combination of the following values:
  1084. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  1085. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  1086. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  1087. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD
  1088. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE
  1089. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOF
  1090. * @retval None
  1091. */
  1092. __STATIC_INLINE void LL_IOP_GRP1_EnableClock(uint32_t Periphs)
  1093. {
  1094. __IO uint32_t tmpreg;
  1095. SET_BIT(RCC->IOPENR, Periphs);
  1096. /* Delay after an RCC peripheral clock enabling */
  1097. tmpreg = READ_BIT(RCC->IOPENR, Periphs);
  1098. (void)tmpreg;
  1099. }
  1100. /**
  1101. * @brief Check if IOP peripheral clock is enabled or not
  1102. * @rmtoll IOPENR GPIOAEN LL_IOP_GRP1_IsEnabledClock\n
  1103. * IOPENR GPIOBEN LL_IOP_GRP1_IsEnabledClock\n
  1104. * IOPENR GPIOCEN LL_IOP_GRP1_IsEnabledClock\n
  1105. * IOPENR GPIODEN LL_IOP_GRP1_IsEnabledClock\n
  1106. * IOPENR GPIOEEN LL_IOP_GRP1_IsEnabledClock\n
  1107. * IOPENR GPIOFEN LL_IOP_GRP1_IsEnabledClock
  1108. * @param Periphs This parameter can be a combination of the following values:
  1109. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  1110. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  1111. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  1112. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD
  1113. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE
  1114. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOF
  1115. * @retval State of Periphs (1 or 0).
  1116. */
  1117. __STATIC_INLINE uint32_t LL_IOP_GRP1_IsEnabledClock(uint32_t Periphs)
  1118. {
  1119. return ((READ_BIT(RCC->IOPENR, Periphs) == Periphs) ? 1UL : 0UL);
  1120. }
  1121. /**
  1122. * @brief Disable IOP peripherals clock.
  1123. * @rmtoll IOPENR GPIOAEN LL_IOP_GRP1_DisableClock\n
  1124. * IOPENR GPIOBEN LL_IOP_GRP1_DisableClock\n
  1125. * IOPENR GPIOCEN LL_IOP_GRP1_DisableClock\n
  1126. * IOPENR GPIODEN LL_IOP_GRP1_DisableClock\n
  1127. * IOPENR GPIOEEN LL_IOP_GRP1_DisableClock\n
  1128. * IOPENR GPIOFEN LL_IOP_GRP1_DisableClock
  1129. * @param Periphs This parameter can be a combination of the following values:
  1130. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  1131. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  1132. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  1133. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD
  1134. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE
  1135. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOF
  1136. * @retval None
  1137. */
  1138. __STATIC_INLINE void LL_IOP_GRP1_DisableClock(uint32_t Periphs)
  1139. {
  1140. CLEAR_BIT(RCC->IOPENR, Periphs);
  1141. }
  1142. /**
  1143. * @brief Disable IOP peripherals clock.
  1144. * @rmtoll IOPRSTR GPIOARST LL_IOP_GRP1_ForceReset\n
  1145. * IOPRSTR GPIOBRST LL_IOP_GRP1_ForceReset\n
  1146. * IOPRSTR GPIOCRST LL_IOP_GRP1_ForceReset\n
  1147. * IOPRSTR GPIODRST LL_IOP_GRP1_ForceReset\n
  1148. * IOPRSTR GPIOERST LL_IOP_GRP1_ForceReset\n
  1149. * IOPRSTR GPIOFRST LL_IOP_GRP1_ForceReset
  1150. * @param Periphs This parameter can be a combination of the following values:
  1151. * @arg @ref LL_IOP_GRP1_PERIPH_ALL
  1152. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  1153. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  1154. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  1155. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD
  1156. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE
  1157. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOF
  1158. * @retval None
  1159. */
  1160. __STATIC_INLINE void LL_IOP_GRP1_ForceReset(uint32_t Periphs)
  1161. {
  1162. SET_BIT(RCC->IOPRSTR, Periphs);
  1163. }
  1164. /**
  1165. * @brief Release IOP peripherals reset.
  1166. * @rmtoll IOPRSTR GPIOARST LL_IOP_GRP1_ReleaseReset\n
  1167. * IOPRSTR GPIOBRST LL_IOP_GRP1_ReleaseReset\n
  1168. * IOPRSTR GPIOCRST LL_IOP_GRP1_ReleaseReset\n
  1169. * IOPRSTR GPIODRST LL_IOP_GRP1_ReleaseReset\n
  1170. * IOPRSTR GPIOERST LL_IOP_GRP1_ReleaseReset\n
  1171. * IOPRSTR GPIOFRST LL_IOP_GRP1_ReleaseReset
  1172. * @param Periphs This parameter can be a combination of the following values:
  1173. * @arg @ref LL_IOP_GRP1_PERIPH_ALL
  1174. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  1175. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  1176. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  1177. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD
  1178. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE
  1179. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOF
  1180. * @retval None
  1181. */
  1182. __STATIC_INLINE void LL_IOP_GRP1_ReleaseReset(uint32_t Periphs)
  1183. {
  1184. CLEAR_BIT(RCC->IOPRSTR, Periphs);
  1185. }
  1186. /**
  1187. * @brief Enable IOP peripheral clocks in Sleep and Stop modes
  1188. * @rmtoll IOPSMENR GPIOASMEN LL_IOP_GRP1_EnableClockStopSleep\n
  1189. * IOPSMENR GPIOBSMEN LL_IOP_GRP1_EnableClockStopSleep\n
  1190. * IOPSMENR GPIOCSMEN LL_IOP_GRP1_EnableClockStopSleep\n
  1191. * IOPSMENR GPIODSMEN LL_IOP_GRP1_EnableClockStopSleep\n
  1192. * IOPSMENR GPIOESMEN LL_IOP_GRP1_EnableClockStopSleep\n
  1193. * IOPSMENR GPIOFSMEN LL_IOP_GRP1_EnableClockStopSleep
  1194. * @param Periphs This parameter can be a combination of the following values:
  1195. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  1196. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  1197. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  1198. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD
  1199. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE
  1200. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOF
  1201. * @retval None
  1202. */
  1203. __STATIC_INLINE void LL_IOP_GRP1_EnableClockStopSleep(uint32_t Periphs)
  1204. {
  1205. __IO uint32_t tmpreg;
  1206. SET_BIT(RCC->IOPSMENR, Periphs);
  1207. /* Delay after an RCC peripheral clock enabling */
  1208. tmpreg = READ_BIT(RCC->IOPSMENR, Periphs);
  1209. (void)tmpreg;
  1210. }
  1211. /**
  1212. * @brief Disable IOP peripheral clocks in Sleep and Stop modes
  1213. * @rmtoll IOPSMENR GPIOASMEN LL_IOP_GRP1_DisableClockStopSleep\n
  1214. * IOPSMENR GPIOBSMEN LL_IOP_GRP1_DisableClockStopSleep\n
  1215. * IOPSMENR GPIOCSMEN LL_IOP_GRP1_DisableClockStopSleep\n
  1216. * IOPSMENR GPIODSMEN LL_IOP_GRP1_DisableClockStopSleep\n
  1217. * IOPSMENR GPIOESMEN LL_IOP_GRP1_DisableClockStopSleep\n
  1218. * IOPSMENR GPIOFSMEN LL_IOP_GRP1_DisableClockStopSleep
  1219. * @param Periphs This parameter can be a combination of the following values:
  1220. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  1221. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  1222. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  1223. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD
  1224. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE
  1225. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOF
  1226. * @retval None
  1227. */
  1228. __STATIC_INLINE void LL_IOP_GRP1_DisableClockStopSleep(uint32_t Periphs)
  1229. {
  1230. CLEAR_BIT(RCC->IOPSMENR, Periphs);
  1231. }
  1232. /**
  1233. * @}
  1234. */
  1235. /**
  1236. * @}
  1237. */
  1238. /**
  1239. * @}
  1240. */
  1241. #endif /* RCC */
  1242. /**
  1243. * @}
  1244. */
  1245. #ifdef __cplusplus
  1246. }
  1247. #endif
  1248. #endif /* STM32G0xx_LL_BUS_H */
  1249. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/