stm32l0xx_ll_bus.h 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168
  1. /**
  2. ******************************************************************************
  3. * @file stm32l0xx_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 __STM32L0xx_LL_BUS_H
  33. #define __STM32L0xx_LL_BUS_H
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /* Includes ------------------------------------------------------------------*/
  38. #include "stm32l0xx.h"
  39. /** @addtogroup STM32L0xx_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 0xFFFFFFFFU
  59. #define LL_AHB1_GRP1_PERIPH_DMA1 RCC_AHBENR_DMA1EN /*!< DMA1 clock enable */
  60. #define LL_AHB1_GRP1_PERIPH_MIF RCC_AHBENR_MIFEN /*!< MIF clock enable */
  61. #define LL_AHB1_GRP1_PERIPH_SRAM RCC_AHBSMENR_SRAMSMEN /*!< Sleep Mode SRAM clock enable */
  62. #define LL_AHB1_GRP1_PERIPH_CRC RCC_AHBENR_CRCEN /*!< CRC clock enable */
  63. #if defined(TSC)
  64. #define LL_AHB1_GRP1_PERIPH_TSC RCC_AHBENR_TSCEN /*!< TSC clock enable */
  65. #endif /*TSC*/
  66. #if defined(RNG)
  67. #define LL_AHB1_GRP1_PERIPH_RNG RCC_AHBENR_RNGEN /*!< RNG clock enable */
  68. #endif /*RNG*/
  69. #if defined(AES)
  70. #define LL_AHB1_GRP1_PERIPH_CRYP RCC_AHBENR_CRYPEN /*!< CRYP clock enable */
  71. #endif /*AES*/
  72. /**
  73. * @}
  74. */
  75. /** @defgroup BUS_LL_EC_APB1_GRP1_PERIPH APB1 GRP1 PERIPH
  76. * @{
  77. */
  78. #define LL_APB1_GRP1_PERIPH_ALL 0xFFFFFFFFU
  79. #define LL_APB1_GRP1_PERIPH_TIM2 RCC_APB1ENR_TIM2EN /*!< TIM2 clock enable */
  80. #if defined(TIM3)
  81. #define LL_APB1_GRP1_PERIPH_TIM3 RCC_APB1ENR_TIM3EN /*!< TIM3 clock enable */
  82. #endif
  83. #if defined(TIM6)
  84. #define LL_APB1_GRP1_PERIPH_TIM6 RCC_APB1ENR_TIM6EN /*!< TIM6 clock enable */
  85. #endif
  86. #if defined(TIM7)
  87. #define LL_APB1_GRP1_PERIPH_TIM7 RCC_APB1ENR_TIM7EN /*!< TIM7 clock enable */
  88. #endif
  89. #if defined(LCD)
  90. #define LL_APB1_GRP1_PERIPH_LCD RCC_APB1ENR_LCDEN /*!< LCD clock enable */
  91. #endif /*LCD*/
  92. #define LL_APB1_GRP1_PERIPH_WWDG RCC_APB1ENR_WWDGEN /*!< WWDG clock enable */
  93. #if defined(SPI2)
  94. #define LL_APB1_GRP1_PERIPH_SPI2 RCC_APB1ENR_SPI2EN /*!< SPI2 clock enable */
  95. #endif
  96. #define LL_APB1_GRP1_PERIPH_USART2 RCC_APB1ENR_USART2EN /*!< USART2 clock enable */
  97. #define LL_APB1_GRP1_PERIPH_LPUART1 RCC_APB1ENR_LPUART1EN /*!< LPUART1 clock enable */
  98. #if defined(USART4)
  99. #define LL_APB1_GRP1_PERIPH_USART4 RCC_APB1ENR_USART4EN /*!< USART4 clock enable */
  100. #endif
  101. #if defined(USART5)
  102. #define LL_APB1_GRP1_PERIPH_USART5 RCC_APB1ENR_USART5EN /*!< USART5 clock enable */
  103. #endif
  104. #define LL_APB1_GRP1_PERIPH_I2C1 RCC_APB1ENR_I2C1EN /*!< I2C1 clock enable */
  105. #if defined(I2C2)
  106. #define LL_APB1_GRP1_PERIPH_I2C2 RCC_APB1ENR_I2C2EN /*!< I2C2 clock enable */
  107. #endif
  108. #if defined(USB)
  109. #define LL_APB1_GRP1_PERIPH_USB RCC_APB1ENR_USBEN /*!< USB clock enable */
  110. #endif /*USB*/
  111. #if defined(CRS)
  112. #define LL_APB1_GRP1_PERIPH_CRS RCC_APB1ENR_CRSEN /*!< CRS clock enable */
  113. #endif /*CRS*/
  114. #define LL_APB1_GRP1_PERIPH_PWR RCC_APB1ENR_PWREN /*!< PWR clock enable */
  115. #if defined(DAC)
  116. #define LL_APB1_GRP1_PERIPH_DAC1 RCC_APB1ENR_DACEN /*!< DAC clock enable */
  117. #endif
  118. #if defined(I2C3)
  119. #define LL_APB1_GRP1_PERIPH_I2C3 RCC_APB1ENR_I2C3EN /*!< I2C3 clock enable */
  120. #endif
  121. #define LL_APB1_GRP1_PERIPH_LPTIM1 RCC_APB1ENR_LPTIM1EN /*!< LPTIM1 clock enable */
  122. /**
  123. * @}
  124. */
  125. /** @defgroup BUS_LL_EC_APB2_GRP1_PERIPH APB2 GRP1 PERIPH
  126. * @{
  127. */
  128. #define LL_APB2_GRP1_PERIPH_ALL 0xFFFFFFFFU
  129. #define LL_APB2_GRP1_PERIPH_SYSCFG RCC_APB2ENR_SYSCFGEN /*!< SYSCFG clock enable */
  130. #define LL_APB2_GRP1_PERIPH_TIM21 RCC_APB2ENR_TIM21EN /*!< TIM21 clock enable */
  131. #if defined(TIM22)
  132. #define LL_APB2_GRP1_PERIPH_TIM22 RCC_APB2ENR_TIM22EN /*!< TIM22 clock enable */
  133. #endif
  134. #define LL_APB2_GRP1_PERIPH_FW RCC_APB2ENR_FWEN /*!< FireWall clock enable */
  135. #define LL_APB2_GRP1_PERIPH_ADC1 RCC_APB2ENR_ADC1EN /*!< ADC1 clock enable */
  136. #define LL_APB2_GRP1_PERIPH_SPI1 RCC_APB2ENR_SPI1EN /*!< SPI1 clock enable */
  137. #if defined(USART1)
  138. #define LL_APB2_GRP1_PERIPH_USART1 RCC_APB2ENR_USART1EN /*!< USART1 clock enable */
  139. #endif
  140. #define LL_APB2_GRP1_PERIPH_DBGMCU RCC_APB2ENR_DBGMCUEN /*!< DBGMCU clock enable */
  141. /**
  142. * @}
  143. */
  144. /** @defgroup BUS_LL_EC_IOP_GRP1_PERIPH IOP GRP1 PERIPH
  145. * @{
  146. */
  147. #define LL_IOP_GRP1_PERIPH_ALL 0xFFFFFFFFU
  148. #define LL_IOP_GRP1_PERIPH_GPIOA RCC_IOPENR_GPIOAEN /*!< GPIO port A control */
  149. #define LL_IOP_GRP1_PERIPH_GPIOB RCC_IOPENR_GPIOBEN /*!< GPIO port B control */
  150. #define LL_IOP_GRP1_PERIPH_GPIOC RCC_IOPENR_GPIOCEN /*!< GPIO port C control */
  151. #if defined(GPIOD)
  152. #define LL_IOP_GRP1_PERIPH_GPIOD RCC_IOPENR_GPIODEN /*!< GPIO port D control */
  153. #endif /*GPIOD*/
  154. #if defined(GPIOE)
  155. #define LL_IOP_GRP1_PERIPH_GPIOE RCC_IOPENR_GPIOEEN /*!< GPIO port H control */
  156. #endif /*GPIOE*/
  157. #if defined(GPIOH)
  158. #define LL_IOP_GRP1_PERIPH_GPIOH RCC_IOPENR_GPIOHEN /*!< GPIO port H control */
  159. #endif /*GPIOH*/
  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 DMAEN LL_AHB1_GRP1_EnableClock\n
  177. * AHBENR MIFEN LL_AHB1_GRP1_EnableClock\n
  178. * AHBENR CRCEN LL_AHB1_GRP1_EnableClock\n
  179. * AHBENR TSCEN LL_AHB1_GRP1_EnableClock\n
  180. * AHBENR RNGEN LL_AHB1_GRP1_EnableClock\n
  181. * AHBENR CRYPEN LL_AHB1_GRP1_EnableClock
  182. * @param Periphs This parameter can be a combination of the following values:
  183. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  184. * @arg @ref LL_AHB1_GRP1_PERIPH_MIF
  185. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  186. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  187. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  188. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  189. *
  190. * (*) value not defined in all devices.
  191. * @retval None
  192. */
  193. __STATIC_INLINE void LL_AHB1_GRP1_EnableClock(uint32_t Periphs)
  194. {
  195. __IO uint32_t tmpreg;
  196. SET_BIT(RCC->AHBENR, Periphs);
  197. /* Delay after an RCC peripheral clock enabling */
  198. tmpreg = READ_BIT(RCC->AHBENR, Periphs);
  199. (void)tmpreg;
  200. }
  201. /**
  202. * @brief Check if AHB1 peripheral clock is enabled or not
  203. * @rmtoll AHBENR DMAEN LL_AHB1_GRP1_IsEnabledClock\n
  204. * AHBENR MIFEN LL_AHB1_GRP1_IsEnabledClock\n
  205. * AHBENR CRCEN LL_AHB1_GRP1_IsEnabledClock\n
  206. * AHBENR TSCEN LL_AHB1_GRP1_IsEnabledClock\n
  207. * AHBENR RNGEN LL_AHB1_GRP1_IsEnabledClock\n
  208. * AHBENR CRYPEN LL_AHB1_GRP1_IsEnabledClock
  209. * @param Periphs This parameter can be a combination of the following values:
  210. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  211. * @arg @ref LL_AHB1_GRP1_PERIPH_MIF
  212. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  213. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  214. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  215. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  216. *
  217. * (*) value not defined in all devices.
  218. * @retval State of Periphs (1 or 0).
  219. */
  220. __STATIC_INLINE uint32_t LL_AHB1_GRP1_IsEnabledClock(uint32_t Periphs)
  221. {
  222. return ((READ_BIT(RCC->AHBENR, Periphs) == (Periphs)) ? 1UL : 0UL);
  223. }
  224. /**
  225. * @brief Disable AHB1 peripherals clock.
  226. * @rmtoll AHBENR DMAEN LL_AHB1_GRP1_DisableClock\n
  227. * AHBENR MIFEN LL_AHB1_GRP1_DisableClock\n
  228. * AHBENR CRCEN LL_AHB1_GRP1_DisableClock\n
  229. * AHBENR TSCEN LL_AHB1_GRP1_DisableClock\n
  230. * AHBENR RNGEN LL_AHB1_GRP1_DisableClock\n
  231. * AHBENR CRYPEN LL_AHB1_GRP1_DisableClock
  232. * @param Periphs This parameter can be a combination of the following values:
  233. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  234. * @arg @ref LL_AHB1_GRP1_PERIPH_MIF
  235. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  236. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  237. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  238. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  239. *
  240. * (*) value not defined in all devices.
  241. * @retval None
  242. */
  243. __STATIC_INLINE void LL_AHB1_GRP1_DisableClock(uint32_t Periphs)
  244. {
  245. CLEAR_BIT(RCC->AHBENR, Periphs);
  246. }
  247. /**
  248. * @brief Force AHB1 peripherals reset.
  249. * @rmtoll AHBRSTR DMARST LL_AHB1_GRP1_ForceReset\n
  250. * AHBRSTR MIFRST LL_AHB1_GRP1_ForceReset\n
  251. * AHBRSTR CRCRST LL_AHB1_GRP1_ForceReset\n
  252. * AHBRSTR TSCRST LL_AHB1_GRP1_ForceReset\n
  253. * AHBRSTR RNGRST LL_AHB1_GRP1_ForceReset\n
  254. * AHBRSTR CRYPRST LL_AHB1_GRP1_ForceReset
  255. * @param Periphs This parameter can be a combination of the following values:
  256. * @arg @ref LL_AHB1_GRP1_PERIPH_ALL
  257. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  258. * @arg @ref LL_AHB1_GRP1_PERIPH_MIF
  259. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  260. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  261. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  262. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  263. *
  264. * (*) value not defined in all devices.
  265. * @retval None
  266. */
  267. __STATIC_INLINE void LL_AHB1_GRP1_ForceReset(uint32_t Periphs)
  268. {
  269. SET_BIT(RCC->AHBRSTR, Periphs);
  270. }
  271. /**
  272. * @brief Release AHB1 peripherals reset.
  273. * @rmtoll AHBRSTR DMARST LL_AHB1_GRP1_ReleaseReset\n
  274. * AHBRSTR MIFRST LL_AHB1_GRP1_ReleaseReset\n
  275. * AHBRSTR CRCRST LL_AHB1_GRP1_ReleaseReset\n
  276. * AHBRSTR TSCRST LL_AHB1_GRP1_ReleaseReset\n
  277. * AHBRSTR RNGRST LL_AHB1_GRP1_ReleaseReset\n
  278. * AHBRSTR CRYPRST LL_AHB1_GRP1_ReleaseReset
  279. * @param Periphs This parameter can be a combination of the following values:
  280. * @arg @ref LL_AHB1_GRP1_PERIPH_ALL
  281. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  282. * @arg @ref LL_AHB1_GRP1_PERIPH_MIF
  283. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  284. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  285. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  286. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  287. *
  288. * (*) value not defined in all devices.
  289. * @retval None
  290. */
  291. __STATIC_INLINE void LL_AHB1_GRP1_ReleaseReset(uint32_t Periphs)
  292. {
  293. CLEAR_BIT(RCC->AHBRSTR, Periphs);
  294. }
  295. /**
  296. * @brief Enable AHB1 peripherals clock during Low Power (Sleep) mode.
  297. * @rmtoll AHBSMENR DMASMEN LL_AHB1_GRP1_EnableClockSleep\n
  298. * AHBSMENR MIFSMEN LL_AHB1_GRP1_EnableClockSleep\n
  299. * AHBSMENR SRAMSMEN LL_AHB1_GRP1_EnableClockSleep\n
  300. * AHBSMENR CRCSMEN LL_AHB1_GRP1_EnableClockSleep\n
  301. * AHBSMENR TSCSMEN LL_AHB1_GRP1_EnableClockSleep\n
  302. * AHBSMENR RNGSMEN LL_AHB1_GRP1_EnableClockSleep\n
  303. * AHBSMENR CRYPSMEN LL_AHB1_GRP1_EnableClockSleep
  304. * @param Periphs This parameter can be a combination of the following values:
  305. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  306. * @arg @ref LL_AHB1_GRP1_PERIPH_MIF
  307. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM
  308. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  309. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  310. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  311. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  312. *
  313. * (*) value not defined in all devices.
  314. * @retval None
  315. */
  316. __STATIC_INLINE void LL_AHB1_GRP1_EnableClockSleep(uint32_t Periphs)
  317. {
  318. __IO uint32_t tmpreg;
  319. SET_BIT(RCC->AHBSMENR, Periphs);
  320. /* Delay after an RCC peripheral clock enabling */
  321. tmpreg = READ_BIT(RCC->AHBSMENR, Periphs);
  322. (void)tmpreg;
  323. }
  324. /**
  325. * @brief Disable AHB1 peripherals clock during Low Power (Sleep) mode.
  326. * @rmtoll AHBSMENR DMASMEN LL_AHB1_GRP1_DisableClockSleep\n
  327. * AHBSMENR MIFSMEN LL_AHB1_GRP1_DisableClockSleep\n
  328. * AHBSMENR SRAMSMEN LL_AHB1_GRP1_DisableClockSleep\n
  329. * AHBSMENR CRCSMEN LL_AHB1_GRP1_DisableClockSleep\n
  330. * AHBSMENR TSCSMEN LL_AHB1_GRP1_DisableClockSleep\n
  331. * AHBSMENR RNGSMEN LL_AHB1_GRP1_DisableClockSleep\n
  332. * AHBSMENR CRYPSMEN LL_AHB1_GRP1_DisableClockSleep
  333. * @param Periphs This parameter can be a combination of the following values:
  334. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  335. * @arg @ref LL_AHB1_GRP1_PERIPH_MIF
  336. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM
  337. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  338. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC (*)
  339. * @arg @ref LL_AHB1_GRP1_PERIPH_RNG (*)
  340. * @arg @ref LL_AHB1_GRP1_PERIPH_CRYP (*)
  341. *
  342. * (*) value not defined in all devices.
  343. * @retval None
  344. */
  345. __STATIC_INLINE void LL_AHB1_GRP1_DisableClockSleep(uint32_t Periphs)
  346. {
  347. CLEAR_BIT(RCC->AHBSMENR, Periphs);
  348. }
  349. /**
  350. * @}
  351. */
  352. /** @defgroup BUS_LL_EF_APB1 APB1
  353. * @{
  354. */
  355. /**
  356. * @brief Enable APB1 peripherals clock.
  357. * @rmtoll APB1ENR TIM2EN LL_APB1_GRP1_EnableClock\n
  358. * APB1ENR TIM3EN LL_APB1_GRP1_EnableClock\n
  359. * APB1ENR TIM6EN LL_APB1_GRP1_EnableClock\n
  360. * APB1ENR TIM7EN LL_APB1_GRP1_EnableClock\n
  361. * APB1ENR LCDEN LL_APB1_GRP1_EnableClock\n
  362. * APB1ENR WWDGEN LL_APB1_GRP1_EnableClock\n
  363. * APB1ENR SPI2EN LL_APB1_GRP1_EnableClock\n
  364. * APB1ENR USART2EN LL_APB1_GRP1_EnableClock\n
  365. * APB1ENR LPUART1EN LL_APB1_GRP1_EnableClock\n
  366. * APB1ENR USART4EN LL_APB1_GRP1_EnableClock\n
  367. * APB1ENR USART5EN LL_APB1_GRP1_EnableClock\n
  368. * APB1ENR I2C1EN LL_APB1_GRP1_EnableClock\n
  369. * APB1ENR I2C2EN LL_APB1_GRP1_EnableClock\n
  370. * APB1ENR USBEN LL_APB1_GRP1_EnableClock\n
  371. * APB1ENR CRSEN LL_APB1_GRP1_EnableClock\n
  372. * APB1ENR PWREN LL_APB1_GRP1_EnableClock\n
  373. * APB1ENR DACEN LL_APB1_GRP1_EnableClock\n
  374. * APB1ENR I2C3EN LL_APB1_GRP1_EnableClock\n
  375. * APB1ENR LPTIM1EN LL_APB1_GRP1_EnableClock
  376. * @param Periphs This parameter can be a combination of the following values:
  377. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  378. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  379. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  380. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  381. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  382. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  383. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  384. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  385. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1
  386. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  387. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  388. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  389. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  390. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  391. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  392. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  393. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  394. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*)
  395. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  396. *
  397. * (*) value not defined in all devices.
  398. * @retval None
  399. */
  400. __STATIC_INLINE void LL_APB1_GRP1_EnableClock(uint32_t Periphs)
  401. {
  402. __IO uint32_t tmpreg;
  403. SET_BIT(RCC->APB1ENR, Periphs);
  404. /* Delay after an RCC peripheral clock enabling */
  405. tmpreg = READ_BIT(RCC->APB1ENR, Periphs);
  406. (void)tmpreg;
  407. }
  408. /**
  409. * @brief Check if APB1 peripheral clock is enabled or not
  410. * @rmtoll APB1ENR TIM2EN LL_APB1_GRP1_IsEnabledClock\n
  411. * APB1ENR TIM3EN LL_APB1_GRP1_IsEnabledClock\n
  412. * APB1ENR TIM6EN LL_APB1_GRP1_IsEnabledClock\n
  413. * APB1ENR TIM7EN LL_APB1_GRP1_IsEnabledClock\n
  414. * APB1ENR LCDEN LL_APB1_GRP1_IsEnabledClock\n
  415. * APB1ENR WWDGEN LL_APB1_GRP1_IsEnabledClock\n
  416. * APB1ENR SPI2EN LL_APB1_GRP1_IsEnabledClock\n
  417. * APB1ENR USART2EN LL_APB1_GRP1_IsEnabledClock\n
  418. * APB1ENR LPUART1EN LL_APB1_GRP1_IsEnabledClock\n
  419. * APB1ENR USART4EN LL_APB1_GRP1_IsEnabledClock\n
  420. * APB1ENR USART5EN LL_APB1_GRP1_IsEnabledClock\n
  421. * APB1ENR I2C1EN LL_APB1_GRP1_IsEnabledClock\n
  422. * APB1ENR I2C2EN LL_APB1_GRP1_IsEnabledClock\n
  423. * APB1ENR USBEN LL_APB1_GRP1_IsEnabledClock\n
  424. * APB1ENR CRSEN LL_APB1_GRP1_IsEnabledClock\n
  425. * APB1ENR PWREN LL_APB1_GRP1_IsEnabledClock\n
  426. * APB1ENR DACEN LL_APB1_GRP1_IsEnabledClock\n
  427. * APB1ENR I2C3EN LL_APB1_GRP1_IsEnabledClock\n
  428. * APB1ENR LPTIM1EN LL_APB1_GRP1_IsEnabledClock
  429. * @param Periphs This parameter can be a combination of the following values:
  430. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  431. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  432. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  433. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  434. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  435. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  436. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  437. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  438. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1
  439. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  440. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  441. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  442. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  443. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  444. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  445. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  446. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  447. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*)
  448. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  449. *
  450. * (*) value not defined in all devices.
  451. * @retval State of Periphs (1 or 0).
  452. */
  453. __STATIC_INLINE uint32_t LL_APB1_GRP1_IsEnabledClock(uint32_t Periphs)
  454. {
  455. return ((READ_BIT(RCC->APB1ENR, Periphs) == (Periphs)) ? 1UL : 0UL);
  456. }
  457. /**
  458. * @brief Disable APB1 peripherals clock.
  459. * @rmtoll APB1ENR TIM2EN LL_APB1_GRP1_DisableClock\n
  460. * APB1ENR TIM3EN LL_APB1_GRP1_DisableClock\n
  461. * APB1ENR TIM6EN LL_APB1_GRP1_DisableClock\n
  462. * APB1ENR TIM7EN LL_APB1_GRP1_DisableClock\n
  463. * APB1ENR LCDEN LL_APB1_GRP1_DisableClock\n
  464. * APB1ENR WWDGEN LL_APB1_GRP1_DisableClock\n
  465. * APB1ENR SPI2EN LL_APB1_GRP1_DisableClock\n
  466. * APB1ENR USART2EN LL_APB1_GRP1_DisableClock\n
  467. * APB1ENR LPUART1EN LL_APB1_GRP1_DisableClock\n
  468. * APB1ENR USART4EN LL_APB1_GRP1_DisableClock\n
  469. * APB1ENR USART5EN LL_APB1_GRP1_DisableClock\n
  470. * APB1ENR I2C1EN LL_APB1_GRP1_DisableClock\n
  471. * APB1ENR I2C2EN LL_APB1_GRP1_DisableClock\n
  472. * APB1ENR USBEN LL_APB1_GRP1_DisableClock\n
  473. * APB1ENR CRSEN LL_APB1_GRP1_DisableClock\n
  474. * APB1ENR PWREN LL_APB1_GRP1_DisableClock\n
  475. * APB1ENR DACEN LL_APB1_GRP1_DisableClock\n
  476. * APB1ENR I2C3EN LL_APB1_GRP1_DisableClock\n
  477. * APB1ENR LPTIM1EN LL_APB1_GRP1_DisableClock
  478. * @param Periphs This parameter can be a combination of the following values:
  479. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  480. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  481. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  482. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  483. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  484. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  485. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  486. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  487. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1
  488. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  489. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  490. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  491. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  492. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  493. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  494. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  495. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  496. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*)
  497. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  498. *
  499. * (*) value not defined in all devices.
  500. * @retval None
  501. */
  502. __STATIC_INLINE void LL_APB1_GRP1_DisableClock(uint32_t Periphs)
  503. {
  504. CLEAR_BIT(RCC->APB1ENR, Periphs);
  505. }
  506. /**
  507. * @brief Force APB1 peripherals reset.
  508. * @rmtoll APB1RSTR TIM2RST LL_APB1_GRP1_ForceReset\n
  509. * APB1RSTR TIM3RST LL_APB1_GRP1_ForceReset\n
  510. * APB1RSTR TIM6RST LL_APB1_GRP1_ForceReset\n
  511. * APB1RSTR TIM7RST LL_APB1_GRP1_ForceReset\n
  512. * APB1RSTR LCDRST LL_APB1_GRP1_ForceReset\n
  513. * APB1RSTR WWDGRST LL_APB1_GRP1_ForceReset\n
  514. * APB1RSTR SPI2RST LL_APB1_GRP1_ForceReset\n
  515. * APB1RSTR USART2RST LL_APB1_GRP1_ForceReset\n
  516. * APB1RSTR LPUART1RST LL_APB1_GRP1_ForceReset\n
  517. * APB1RSTR USART4RST LL_APB1_GRP1_ForceReset\n
  518. * APB1RSTR USART5RST LL_APB1_GRP1_ForceReset\n
  519. * APB1RSTR I2C1RST LL_APB1_GRP1_ForceReset\n
  520. * APB1RSTR I2C2RST LL_APB1_GRP1_ForceReset\n
  521. * APB1RSTR USBRST LL_APB1_GRP1_ForceReset\n
  522. * APB1RSTR CRSRST LL_APB1_GRP1_ForceReset\n
  523. * APB1RSTR PWRRST LL_APB1_GRP1_ForceReset\n
  524. * APB1RSTR DACRST LL_APB1_GRP1_ForceReset\n
  525. * APB1RSTR I2C3RST LL_APB1_GRP1_ForceReset\n
  526. * APB1RSTR LPTIM1RST LL_APB1_GRP1_ForceReset
  527. * @param Periphs This parameter can be a combination of the following values:
  528. * @arg @ref LL_APB1_GRP1_PERIPH_ALL
  529. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  530. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  531. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  532. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  533. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  534. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  535. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  536. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  537. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1
  538. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  539. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  540. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  541. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  542. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  543. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  544. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  545. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  546. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*)
  547. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  548. *
  549. * (*) value not defined in all devices.
  550. * @retval None
  551. */
  552. __STATIC_INLINE void LL_APB1_GRP1_ForceReset(uint32_t Periphs)
  553. {
  554. SET_BIT(RCC->APB1RSTR, Periphs);
  555. }
  556. /**
  557. * @brief Release APB1 peripherals reset.
  558. * @rmtoll APB1RSTR TIM2RST LL_APB1_GRP1_ReleaseReset\n
  559. * APB1RSTR TIM3RST LL_APB1_GRP1_ReleaseReset\n
  560. * APB1RSTR TIM6RST LL_APB1_GRP1_ReleaseReset\n
  561. * APB1RSTR TIM7RST LL_APB1_GRP1_ReleaseReset\n
  562. * APB1RSTR LCDRST LL_APB1_GRP1_ReleaseReset\n
  563. * APB1RSTR WWDGRST LL_APB1_GRP1_ReleaseReset\n
  564. * APB1RSTR SPI2RST LL_APB1_GRP1_ReleaseReset\n
  565. * APB1RSTR USART2RST LL_APB1_GRP1_ReleaseReset\n
  566. * APB1RSTR LPUART1RST LL_APB1_GRP1_ReleaseReset\n
  567. * APB1RSTR USART4RST LL_APB1_GRP1_ReleaseReset\n
  568. * APB1RSTR USART5RST LL_APB1_GRP1_ReleaseReset\n
  569. * APB1RSTR I2C1RST LL_APB1_GRP1_ReleaseReset\n
  570. * APB1RSTR I2C2RST LL_APB1_GRP1_ReleaseReset\n
  571. * APB1RSTR USBRST LL_APB1_GRP1_ReleaseReset\n
  572. * APB1RSTR CRSRST LL_APB1_GRP1_ReleaseReset\n
  573. * APB1RSTR PWRRST LL_APB1_GRP1_ReleaseReset\n
  574. * APB1RSTR DACRST LL_APB1_GRP1_ReleaseReset\n
  575. * APB1RSTR I2C3RST LL_APB1_GRP1_ReleaseReset\n
  576. * APB1RSTR LPTIM1RST LL_APB1_GRP1_ReleaseReset
  577. * @param Periphs This parameter can be a combination of the following values:
  578. * @arg @ref LL_APB1_GRP1_PERIPH_ALL
  579. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  580. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  581. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  582. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  583. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  584. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  585. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  586. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  587. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1
  588. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  589. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  590. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  591. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  592. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  593. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  594. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  595. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  596. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*)
  597. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  598. *
  599. * (*) value not defined in all devices.
  600. * @retval None
  601. */
  602. __STATIC_INLINE void LL_APB1_GRP1_ReleaseReset(uint32_t Periphs)
  603. {
  604. CLEAR_BIT(RCC->APB1RSTR, Periphs);
  605. }
  606. /**
  607. * @brief Enable APB1 peripherals clock during Low Power (Sleep) mode.
  608. * @rmtoll APB1SMENR TIM2SMEN LL_APB1_GRP1_EnableClockSleep\n
  609. * APB1SMENR TIM3SMEN LL_APB1_GRP1_EnableClockSleep\n
  610. * APB1SMENR TIM6SMEN LL_APB1_GRP1_EnableClockSleep\n
  611. * APB1SMENR TIM7SMEN LL_APB1_GRP1_EnableClockSleep\n
  612. * APB1SMENR LCDSMEN LL_APB1_GRP1_EnableClockSleep\n
  613. * APB1SMENR WWDGSMEN LL_APB1_GRP1_EnableClockSleep\n
  614. * APB1SMENR SPI2SMEN LL_APB1_GRP1_EnableClockSleep\n
  615. * APB1SMENR USART2SMEN LL_APB1_GRP1_EnableClockSleep\n
  616. * APB1SMENR LPUART1SMEN LL_APB1_GRP1_EnableClockSleep\n
  617. * APB1SMENR USART4SMEN LL_APB1_GRP1_EnableClockSleep\n
  618. * APB1SMENR USART5SMEN LL_APB1_GRP1_EnableClockSleep\n
  619. * APB1SMENR I2C1SMEN LL_APB1_GRP1_EnableClockSleep\n
  620. * APB1SMENR I2C2SMEN LL_APB1_GRP1_EnableClockSleep\n
  621. * APB1SMENR USBSMEN LL_APB1_GRP1_EnableClockSleep\n
  622. * APB1SMENR CRSSMEN LL_APB1_GRP1_EnableClockSleep\n
  623. * APB1SMENR PWRSMEN LL_APB1_GRP1_EnableClockSleep\n
  624. * APB1SMENR DACSMEN LL_APB1_GRP1_EnableClockSleep\n
  625. * APB1SMENR I2C3SMEN LL_APB1_GRP1_EnableClockSleep\n
  626. * APB1SMENR LPTIM1SMEN LL_APB1_GRP1_EnableClockSleep
  627. * @param Periphs This parameter can be a combination of the following values:
  628. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  629. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  630. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  631. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  632. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  633. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  634. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  635. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  636. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1
  637. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  638. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  639. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  640. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  641. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  642. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  643. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  644. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  645. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*)
  646. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  647. *
  648. * (*) value not defined in all devices.
  649. * @retval None
  650. */
  651. __STATIC_INLINE void LL_APB1_GRP1_EnableClockSleep(uint32_t Periphs)
  652. {
  653. __IO uint32_t tmpreg;
  654. SET_BIT(RCC->APB1SMENR, Periphs);
  655. /* Delay after an RCC peripheral clock enabling */
  656. tmpreg = READ_BIT(RCC->APB1SMENR, Periphs);
  657. (void)tmpreg;
  658. }
  659. /**
  660. * @brief Disable APB1 peripherals clock during Low Power (Sleep) mode.
  661. * @rmtoll APB1SMENR TIM2SMEN LL_APB1_GRP1_DisableClockSleep\n
  662. * APB1SMENR TIM3SMEN LL_APB1_GRP1_DisableClockSleep\n
  663. * APB1SMENR TIM6SMEN LL_APB1_GRP1_DisableClockSleep\n
  664. * APB1SMENR TIM7SMEN LL_APB1_GRP1_DisableClockSleep\n
  665. * APB1SMENR LCDSMEN LL_APB1_GRP1_DisableClockSleep\n
  666. * APB1SMENR WWDGSMEN LL_APB1_GRP1_DisableClockSleep\n
  667. * APB1SMENR SPI2SMEN LL_APB1_GRP1_DisableClockSleep\n
  668. * APB1SMENR USART2SMEN LL_APB1_GRP1_DisableClockSleep\n
  669. * APB1SMENR LPUART1SMEN LL_APB1_GRP1_DisableClockSleep\n
  670. * APB1SMENR USART4SMEN LL_APB1_GRP1_DisableClockSleep\n
  671. * APB1SMENR USART5SMEN LL_APB1_GRP1_DisableClockSleep\n
  672. * APB1SMENR I2C1SMEN LL_APB1_GRP1_DisableClockSleep\n
  673. * APB1SMENR I2C2SMEN LL_APB1_GRP1_DisableClockSleep\n
  674. * APB1SMENR USBSMEN LL_APB1_GRP1_DisableClockSleep\n
  675. * APB1SMENR CRSSMEN LL_APB1_GRP1_DisableClockSleep\n
  676. * APB1SMENR PWRSMEN LL_APB1_GRP1_DisableClockSleep\n
  677. * APB1SMENR DACSMEN LL_APB1_GRP1_DisableClockSleep\n
  678. * APB1SMENR I2C3SMEN LL_APB1_GRP1_DisableClockSleep\n
  679. * APB1SMENR LPTIM1SMEN LL_APB1_GRP1_DisableClockSleep
  680. * @param Periphs This parameter can be a combination of the following values:
  681. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  682. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  683. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)
  684. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)
  685. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  686. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  687. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  688. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  689. * @arg @ref LL_APB1_GRP1_PERIPH_LPUART1
  690. * @arg @ref LL_APB1_GRP1_PERIPH_USART4 (*)
  691. * @arg @ref LL_APB1_GRP1_PERIPH_USART5 (*)
  692. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  693. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  694. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  695. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  696. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  697. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)
  698. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*)
  699. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  700. *
  701. * (*) value not defined in all devices.
  702. * @retval None
  703. */
  704. __STATIC_INLINE void LL_APB1_GRP1_DisableClockSleep(uint32_t Periphs)
  705. {
  706. CLEAR_BIT(RCC->APB1SMENR, Periphs);
  707. }
  708. /**
  709. * @}
  710. */
  711. /** @defgroup BUS_LL_EF_APB2 APB2
  712. * @{
  713. */
  714. /**
  715. * @brief Enable APB2 peripherals clock.
  716. * @rmtoll APB2ENR SYSCFGEN LL_APB2_GRP1_EnableClock\n
  717. * APB2ENR TIM21EN LL_APB2_GRP1_EnableClock\n
  718. * APB2ENR TIM22EN LL_APB2_GRP1_EnableClock\n
  719. * APB2ENR FWEN LL_APB2_GRP1_EnableClock\n
  720. * APB2ENR ADCEN LL_APB2_GRP1_EnableClock\n
  721. * APB2ENR SPI1EN LL_APB2_GRP1_EnableClock\n
  722. * APB2ENR USART1EN LL_APB2_GRP1_EnableClock\n
  723. * APB2ENR DBGEN LL_APB2_GRP1_EnableClock
  724. * @param Periphs This parameter can be a combination of the following values:
  725. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  726. * @arg @ref LL_APB2_GRP1_PERIPH_TIM21
  727. * @arg @ref LL_APB2_GRP1_PERIPH_TIM22 (*)
  728. * @arg @ref LL_APB2_GRP1_PERIPH_FW
  729. * @arg @ref LL_APB2_GRP1_PERIPH_ADC1
  730. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  731. * @arg @ref LL_APB2_GRP1_PERIPH_USART1 (*)
  732. * @arg @ref LL_APB2_GRP1_PERIPH_DBGMCU
  733. *
  734. * (*) value not defined in all devices.
  735. * @retval None
  736. */
  737. __STATIC_INLINE void LL_APB2_GRP1_EnableClock(uint32_t Periphs)
  738. {
  739. __IO uint32_t tmpreg;
  740. SET_BIT(RCC->APB2ENR, Periphs);
  741. /* Delay after an RCC peripheral clock enabling */
  742. tmpreg = READ_BIT(RCC->APB2ENR, Periphs);
  743. (void)tmpreg;
  744. }
  745. /**
  746. * @brief Check if APB2 peripheral clock is enabled or not
  747. * @rmtoll APB2ENR SYSCFGEN LL_APB2_GRP1_IsEnabledClock\n
  748. * APB2ENR TIM21EN LL_APB2_GRP1_IsEnabledClock\n
  749. * APB2ENR TIM22EN LL_APB2_GRP1_IsEnabledClock\n
  750. * APB2ENR FWEN LL_APB2_GRP1_IsEnabledClock\n
  751. * APB2ENR ADCEN LL_APB2_GRP1_IsEnabledClock\n
  752. * APB2ENR SPI1EN LL_APB2_GRP1_IsEnabledClock\n
  753. * APB2ENR USART1EN LL_APB2_GRP1_IsEnabledClock\n
  754. * APB2ENR DBGEN LL_APB2_GRP1_IsEnabledClock
  755. * @param Periphs This parameter can be a combination of the following values:
  756. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  757. * @arg @ref LL_APB2_GRP1_PERIPH_TIM21
  758. * @arg @ref LL_APB2_GRP1_PERIPH_TIM22 (*)
  759. * @arg @ref LL_APB2_GRP1_PERIPH_FW
  760. * @arg @ref LL_APB2_GRP1_PERIPH_ADC1
  761. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  762. * @arg @ref LL_APB2_GRP1_PERIPH_USART1 (*)
  763. * @arg @ref LL_APB2_GRP1_PERIPH_DBGMCU
  764. *
  765. * (*) value not defined in all devices.
  766. * @retval State of Periphs (1 or 0).
  767. */
  768. __STATIC_INLINE uint32_t LL_APB2_GRP1_IsEnabledClock(uint32_t Periphs)
  769. {
  770. return ((READ_BIT(RCC->APB2ENR, Periphs) == (Periphs)) ? 1UL : 0UL);
  771. }
  772. /**
  773. * @brief Disable APB2 peripherals clock.
  774. * @rmtoll APB2ENR SYSCFGEN LL_APB2_GRP1_DisableClock\n
  775. * APB2ENR TIM21EN LL_APB2_GRP1_DisableClock\n
  776. * APB2ENR TIM22EN LL_APB2_GRP1_DisableClock\n
  777. * APB2ENR FWEN LL_APB2_GRP1_DisableClock\n
  778. * APB2ENR ADCEN LL_APB2_GRP1_DisableClock\n
  779. * APB2ENR SPI1EN LL_APB2_GRP1_DisableClock\n
  780. * APB2ENR USART1EN LL_APB2_GRP1_DisableClock\n
  781. * APB2ENR DBGEN LL_APB2_GRP1_DisableClock
  782. * @param Periphs This parameter can be a combination of the following values:
  783. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  784. * @arg @ref LL_APB2_GRP1_PERIPH_TIM21
  785. * @arg @ref LL_APB2_GRP1_PERIPH_TIM22 (*)
  786. * @arg @ref LL_APB2_GRP1_PERIPH_FW
  787. * @arg @ref LL_APB2_GRP1_PERIPH_ADC1
  788. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  789. * @arg @ref LL_APB2_GRP1_PERIPH_USART1 (*)
  790. * @arg @ref LL_APB2_GRP1_PERIPH_DBGMCU
  791. *
  792. * (*) value not defined in all devices.
  793. * @retval None
  794. */
  795. __STATIC_INLINE void LL_APB2_GRP1_DisableClock(uint32_t Periphs)
  796. {
  797. CLEAR_BIT(RCC->APB2ENR, Periphs);
  798. }
  799. /**
  800. * @brief Force APB2 peripherals reset.
  801. * @rmtoll APB2RSTR SYSCFGRST LL_APB2_GRP1_ForceReset\n
  802. * APB2RSTR TIM21RST LL_APB2_GRP1_ForceReset\n
  803. * APB2RSTR TIM22RST LL_APB2_GRP1_ForceReset\n
  804. * APB2RSTR ADCRST LL_APB2_GRP1_ForceReset\n
  805. * APB2RSTR SPI1RST LL_APB2_GRP1_ForceReset\n
  806. * APB2RSTR USART1RST LL_APB2_GRP1_ForceReset\n
  807. * APB2RSTR DBGRST LL_APB2_GRP1_ForceReset
  808. * @param Periphs This parameter can be a combination of the following values:
  809. * @arg @ref LL_APB2_GRP1_PERIPH_ALL
  810. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  811. * @arg @ref LL_APB2_GRP1_PERIPH_TIM21
  812. * @arg @ref LL_APB2_GRP1_PERIPH_TIM22 (*)
  813. * @arg @ref LL_APB2_GRP1_PERIPH_ADC1
  814. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  815. * @arg @ref LL_APB2_GRP1_PERIPH_USART1 (*)
  816. * @arg @ref LL_APB2_GRP1_PERIPH_DBGMCU
  817. *
  818. * (*) value not defined in all devices.
  819. * @retval None
  820. */
  821. __STATIC_INLINE void LL_APB2_GRP1_ForceReset(uint32_t Periphs)
  822. {
  823. SET_BIT(RCC->APB2RSTR, Periphs);
  824. }
  825. /**
  826. * @brief Release APB2 peripherals reset.
  827. * @rmtoll APB2RSTR SYSCFGRST LL_APB2_GRP1_ReleaseReset\n
  828. * APB2RSTR TIM21RST LL_APB2_GRP1_ReleaseReset\n
  829. * APB2RSTR TIM22RST LL_APB2_GRP1_ReleaseReset\n
  830. * APB2RSTR ADCRST LL_APB2_GRP1_ReleaseReset\n
  831. * APB2RSTR SPI1RST LL_APB2_GRP1_ReleaseReset\n
  832. * APB2RSTR USART1RST LL_APB2_GRP1_ReleaseReset\n
  833. * APB2RSTR DBGRST LL_APB2_GRP1_ReleaseReset
  834. * @param Periphs This parameter can be a combination of the following values:
  835. * @arg @ref LL_APB2_GRP1_PERIPH_ALL
  836. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  837. * @arg @ref LL_APB2_GRP1_PERIPH_TIM21
  838. * @arg @ref LL_APB2_GRP1_PERIPH_TIM22 (*)
  839. * @arg @ref LL_APB2_GRP1_PERIPH_ADC1
  840. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  841. * @arg @ref LL_APB2_GRP1_PERIPH_USART1 (*)
  842. * @arg @ref LL_APB2_GRP1_PERIPH_DBGMCU
  843. *
  844. * (*) value not defined in all devices.
  845. * @retval None
  846. */
  847. __STATIC_INLINE void LL_APB2_GRP1_ReleaseReset(uint32_t Periphs)
  848. {
  849. CLEAR_BIT(RCC->APB2RSTR, Periphs);
  850. }
  851. /**
  852. * @brief Enable APB2 peripherals clock during Low Power (Sleep) mode.
  853. * @rmtoll APB2SMENR SYSCFGSMEN LL_APB2_GRP1_EnableClockSleep\n
  854. * APB2SMENR TIM21SMEN LL_APB2_GRP1_EnableClockSleep\n
  855. * APB2SMENR TIM22SMEN LL_APB2_GRP1_EnableClockSleep\n
  856. * APB2SMENR ADCSMEN LL_APB2_GRP1_EnableClockSleep\n
  857. * APB2SMENR SPI1SMEN LL_APB2_GRP1_EnableClockSleep\n
  858. * APB2SMENR USART1SMEN LL_APB2_GRP1_EnableClockSleep\n
  859. * APB2SMENR DBGSMEN LL_APB2_GRP1_EnableClockSleep
  860. * @param Periphs This parameter can be a combination of the following values:
  861. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  862. * @arg @ref LL_APB2_GRP1_PERIPH_TIM21
  863. * @arg @ref LL_APB2_GRP1_PERIPH_TIM22 (*)
  864. * @arg @ref LL_APB2_GRP1_PERIPH_ADC1
  865. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  866. * @arg @ref LL_APB2_GRP1_PERIPH_USART1 (*)
  867. * @arg @ref LL_APB2_GRP1_PERIPH_DBGMCU
  868. *
  869. * (*) value not defined in all devices.
  870. * @retval None
  871. */
  872. __STATIC_INLINE void LL_APB2_GRP1_EnableClockSleep(uint32_t Periphs)
  873. {
  874. __IO uint32_t tmpreg;
  875. SET_BIT(RCC->APB2SMENR, Periphs);
  876. /* Delay after an RCC peripheral clock enabling */
  877. tmpreg = READ_BIT(RCC->APB2SMENR, Periphs);
  878. (void)tmpreg;
  879. }
  880. /**
  881. * @brief Disable APB2 peripherals clock during Low Power (Sleep) mode.
  882. * @rmtoll APB2SMENR SYSCFGSMEN LL_APB2_GRP1_DisableClockSleep\n
  883. * APB2SMENR TIM21SMEN LL_APB2_GRP1_DisableClockSleep\n
  884. * APB2SMENR TIM22SMEN LL_APB2_GRP1_DisableClockSleep\n
  885. * APB2SMENR ADCSMEN LL_APB2_GRP1_DisableClockSleep\n
  886. * APB2SMENR SPI1SMEN LL_APB2_GRP1_DisableClockSleep\n
  887. * APB2SMENR USART1SMEN LL_APB2_GRP1_DisableClockSleep\n
  888. * APB2SMENR DBGSMEN LL_APB2_GRP1_DisableClockSleep
  889. * @param Periphs This parameter can be a combination of the following values:
  890. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  891. * @arg @ref LL_APB2_GRP1_PERIPH_TIM21
  892. * @arg @ref LL_APB2_GRP1_PERIPH_TIM22 (*)
  893. * @arg @ref LL_APB2_GRP1_PERIPH_ADC1
  894. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  895. * @arg @ref LL_APB2_GRP1_PERIPH_USART1 (*)
  896. * @arg @ref LL_APB2_GRP1_PERIPH_DBGMCU
  897. *
  898. * (*) value not defined in all devices.
  899. * @retval None
  900. */
  901. __STATIC_INLINE void LL_APB2_GRP1_DisableClockSleep(uint32_t Periphs)
  902. {
  903. CLEAR_BIT(RCC->APB2SMENR, Periphs);
  904. }
  905. /**
  906. * @}
  907. */
  908. /** @defgroup BUS_LL_EF_IOP IOP
  909. * @{
  910. */
  911. /**
  912. * @brief Enable IOP peripherals clock.
  913. * @rmtoll IOPENR GPIOAEN LL_IOP_GRP1_EnableClock\n
  914. * IOPENR GPIOBEN LL_IOP_GRP1_EnableClock\n
  915. * IOPENR GPIOCEN LL_IOP_GRP1_EnableClock\n
  916. * IOPENR GPIODEN LL_IOP_GRP1_EnableClock\n
  917. * IOPENR GPIOEEN LL_IOP_GRP1_EnableClock\n
  918. * IOPENR GPIOHEN LL_IOP_GRP1_EnableClock
  919. * @param Periphs This parameter can be a combination of the following values:
  920. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  921. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  922. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  923. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD (*)
  924. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE (*)
  925. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOH (*)
  926. *
  927. * (*) value not defined in all devices.
  928. * @retval None
  929. */
  930. __STATIC_INLINE void LL_IOP_GRP1_EnableClock(uint32_t Periphs)
  931. {
  932. __IO uint32_t tmpreg;
  933. SET_BIT(RCC->IOPENR, Periphs);
  934. /* Delay after an RCC peripheral clock enabling */
  935. tmpreg = READ_BIT(RCC->IOPENR, Periphs);
  936. (void)tmpreg;
  937. }
  938. /**
  939. * @brief Check if IOP peripheral clock is enabled or not
  940. * @rmtoll IOPENR GPIOAEN LL_IOP_GRP1_IsEnabledClock\n
  941. * IOPENR GPIOBEN LL_IOP_GRP1_IsEnabledClock\n
  942. * IOPENR GPIOCEN LL_IOP_GRP1_IsEnabledClock\n
  943. * IOPENR GPIODEN LL_IOP_GRP1_IsEnabledClock\n
  944. * IOPENR GPIOEEN LL_IOP_GRP1_IsEnabledClock\n
  945. * IOPENR GPIOHEN LL_IOP_GRP1_IsEnabledClock
  946. * @param Periphs This parameter can be a combination of the following values:
  947. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  948. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  949. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  950. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD (*)
  951. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE (*)
  952. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOH (*)
  953. *
  954. * (*) value not defined in all devices.
  955. * @retval State of Periphs (1 or 0).
  956. */
  957. __STATIC_INLINE uint32_t LL_IOP_GRP1_IsEnabledClock(uint32_t Periphs)
  958. {
  959. return ((READ_BIT(RCC->IOPENR, Periphs) == (Periphs)) ? 1UL : 0UL);
  960. }
  961. /**
  962. * @brief Disable IOP peripherals clock.
  963. * @rmtoll IOPENR GPIOAEN LL_IOP_GRP1_DisableClock\n
  964. * IOPENR GPIOBEN LL_IOP_GRP1_DisableClock\n
  965. * IOPENR GPIOCEN LL_IOP_GRP1_DisableClock\n
  966. * IOPENR GPIODEN LL_IOP_GRP1_DisableClock\n
  967. * IOPENR GPIOEEN LL_IOP_GRP1_DisableClock\n
  968. * IOPENR GPIOHEN LL_IOP_GRP1_DisableClock
  969. * @param Periphs This parameter can be a combination of the following values:
  970. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  971. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  972. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  973. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD (*)
  974. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE (*)
  975. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOH (*)
  976. *
  977. * (*) value not defined in all devices.
  978. * @retval None
  979. */
  980. __STATIC_INLINE void LL_IOP_GRP1_DisableClock(uint32_t Periphs)
  981. {
  982. CLEAR_BIT(RCC->IOPENR, Periphs);
  983. }
  984. /**
  985. * @brief Disable IOP peripherals clock.
  986. * @rmtoll IOPRSTR GPIOASMEN LL_IOP_GRP1_ForceReset\n
  987. * IOPRSTR GPIOBSMEN LL_IOP_GRP1_ForceReset\n
  988. * IOPRSTR GPIOCSMEN LL_IOP_GRP1_ForceReset\n
  989. * IOPRSTR GPIODSMEN LL_IOP_GRP1_ForceReset\n
  990. * IOPRSTR GPIOESMEN LL_IOP_GRP1_ForceReset\n
  991. * IOPRSTR GPIOHSMEN LL_IOP_GRP1_ForceReset
  992. * @param Periphs This parameter can be a combination of the following values:
  993. * @arg @ref LL_IOP_GRP1_PERIPH_ALL
  994. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  995. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  996. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  997. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD (*)
  998. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE (*)
  999. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOH (*)
  1000. *
  1001. * (*) value not defined in all devices.
  1002. * @retval None
  1003. */
  1004. __STATIC_INLINE void LL_IOP_GRP1_ForceReset(uint32_t Periphs)
  1005. {
  1006. SET_BIT(RCC->IOPRSTR, Periphs);
  1007. }
  1008. /**
  1009. * @brief Release IOP peripherals reset.
  1010. * @rmtoll IOPRSTR GPIOASMEN LL_IOP_GRP1_ReleaseReset\n
  1011. * IOPRSTR GPIOBSMEN LL_IOP_GRP1_ReleaseReset\n
  1012. * IOPRSTR GPIOCSMEN LL_IOP_GRP1_ReleaseReset\n
  1013. * IOPRSTR GPIODSMEN LL_IOP_GRP1_ReleaseReset\n
  1014. * IOPRSTR GPIOESMEN LL_IOP_GRP1_ReleaseReset\n
  1015. * IOPRSTR GPIOHSMEN LL_IOP_GRP1_ReleaseReset
  1016. * @param Periphs This parameter can be a combination of the following values:
  1017. * @arg @ref LL_IOP_GRP1_PERIPH_ALL
  1018. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  1019. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  1020. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  1021. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD (*)
  1022. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE (*)
  1023. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOH (*)
  1024. *
  1025. * (*) value not defined in all devices.
  1026. * @retval None
  1027. */
  1028. __STATIC_INLINE void LL_IOP_GRP1_ReleaseReset(uint32_t Periphs)
  1029. {
  1030. CLEAR_BIT(RCC->IOPRSTR, Periphs);
  1031. }
  1032. /**
  1033. * @brief Enable IOP peripherals clock during Low Power (Sleep) mode.
  1034. * @rmtoll IOPSMENR GPIOARST LL_IOP_GRP1_EnableClockSleep\n
  1035. * IOPSMENR GPIOBRST LL_IOP_GRP1_EnableClockSleep\n
  1036. * IOPSMENR GPIOCRST LL_IOP_GRP1_EnableClockSleep\n
  1037. * IOPSMENR GPIODRST LL_IOP_GRP1_EnableClockSleep\n
  1038. * IOPSMENR GPIOERST LL_IOP_GRP1_EnableClockSleep\n
  1039. * IOPSMENR GPIOHRST LL_IOP_GRP1_EnableClockSleep
  1040. * @param Periphs This parameter can be a combination of the following values:
  1041. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  1042. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  1043. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  1044. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD (*)
  1045. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE (*)
  1046. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOH (*)
  1047. *
  1048. * (*) value not defined in all devices.
  1049. * @retval None
  1050. */
  1051. __STATIC_INLINE void LL_IOP_GRP1_EnableClockSleep(uint32_t Periphs)
  1052. {
  1053. __IO uint32_t tmpreg;
  1054. SET_BIT(RCC->IOPSMENR, Periphs);
  1055. /* Delay after an RCC peripheral clock enabling */
  1056. tmpreg = READ_BIT(RCC->IOPSMENR, Periphs);
  1057. (void)tmpreg;
  1058. }
  1059. /**
  1060. * @brief Disable IOP peripherals clock during Low Power (Sleep) mode.
  1061. * @rmtoll IOPSMENR GPIOARST LL_IOP_GRP1_DisableClockSleep\n
  1062. * IOPSMENR GPIOBRST LL_IOP_GRP1_DisableClockSleep\n
  1063. * IOPSMENR GPIOCRST LL_IOP_GRP1_DisableClockSleep\n
  1064. * IOPSMENR GPIODRST LL_IOP_GRP1_DisableClockSleep\n
  1065. * IOPSMENR GPIOERST LL_IOP_GRP1_DisableClockSleep\n
  1066. * IOPSMENR GPIOHRST LL_IOP_GRP1_DisableClockSleep
  1067. * @param Periphs This parameter can be a combination of the following values:
  1068. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOA
  1069. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOB
  1070. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOC
  1071. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOD (*)
  1072. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOE (*)
  1073. * @arg @ref LL_IOP_GRP1_PERIPH_GPIOH (*)
  1074. *
  1075. * (*) value not defined in all devices.
  1076. * @retval None
  1077. */
  1078. __STATIC_INLINE void LL_IOP_GRP1_DisableClockSleep(uint32_t Periphs)
  1079. {
  1080. CLEAR_BIT(RCC->IOPSMENR, Periphs);
  1081. }
  1082. /**
  1083. * @}
  1084. */
  1085. /**
  1086. * @}
  1087. */
  1088. /**
  1089. * @}
  1090. */
  1091. #endif /* defined(RCC) */
  1092. /**
  1093. * @}
  1094. */
  1095. #ifdef __cplusplus
  1096. }
  1097. #endif
  1098. #endif /* __STM32L0xx_LL_BUS_H */