stm32l4xx_ll_bus.h 89 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970
  1. /**
  2. ******************************************************************************
  3. * @file stm32l4xx_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) 2017 STMicroelectronics</center></h2>
  24. *
  25. * Redistribution and use in source and binary forms, with or without modification,
  26. * are permitted provided that the following conditions are met:
  27. * 1. Redistributions of source code must retain the above copyright notice,
  28. * this list of conditions and the following disclaimer.
  29. * 2. Redistributions in binary form must reproduce the above copyright notice,
  30. * this list of conditions and the following disclaimer in the documentation
  31. * and/or other materials provided with the distribution.
  32. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  33. * may be used to endorse or promote products derived from this software
  34. * without specific prior written permission.
  35. *
  36. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  37. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  38. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  39. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  40. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  41. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  42. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  43. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  44. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  45. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  46. *
  47. ******************************************************************************
  48. */
  49. /* Define to prevent recursive inclusion -------------------------------------*/
  50. #ifndef __STM32L4xx_LL_BUS_H
  51. #define __STM32L4xx_LL_BUS_H
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55. /* Includes ------------------------------------------------------------------*/
  56. #include "stm32l4xx.h"
  57. /** @addtogroup STM32L4xx_LL_Driver
  58. * @{
  59. */
  60. #if defined(RCC)
  61. /** @defgroup BUS_LL BUS
  62. * @{
  63. */
  64. /* Private types -------------------------------------------------------------*/
  65. /* Private variables ---------------------------------------------------------*/
  66. /* Private constants ---------------------------------------------------------*/
  67. /* Private macros ------------------------------------------------------------*/
  68. /* Exported types ------------------------------------------------------------*/
  69. /* Exported constants --------------------------------------------------------*/
  70. /** @defgroup BUS_LL_Exported_Constants BUS Exported Constants
  71. * @{
  72. */
  73. /** @defgroup BUS_LL_EC_AHB1_GRP1_PERIPH AHB1 GRP1 PERIPH
  74. * @{
  75. */
  76. #define LL_AHB1_GRP1_PERIPH_ALL 0xFFFFFFFFU
  77. #define LL_AHB1_GRP1_PERIPH_DMA1 RCC_AHB1ENR_DMA1EN
  78. #define LL_AHB1_GRP1_PERIPH_DMA2 RCC_AHB1ENR_DMA2EN
  79. #if defined(DMAMUX1)
  80. #define LL_AHB1_GRP1_PERIPH_DMAMUX1 RCC_AHB1ENR_DMAMUX1EN
  81. #endif /* DMAMUX1 */
  82. #define LL_AHB1_GRP1_PERIPH_FLASH RCC_AHB1ENR_FLASHEN
  83. #define LL_AHB1_GRP1_PERIPH_CRC RCC_AHB1ENR_CRCEN
  84. #define LL_AHB1_GRP1_PERIPH_TSC RCC_AHB1ENR_TSCEN
  85. #if defined(DMA2D)
  86. #define LL_AHB1_GRP1_PERIPH_DMA2D RCC_AHB1ENR_DMA2DEN
  87. #endif /* DMA2D */
  88. #if defined(GFXMMU)
  89. #define LL_AHB1_GRP1_PERIPH_GFXMMU RCC_AHB1ENR_GFXMMUEN
  90. #endif /* GFXMMU */
  91. #define LL_AHB1_GRP1_PERIPH_SRAM1 RCC_AHB1SMENR_SRAM1SMEN
  92. /**
  93. * @}
  94. */
  95. /** @defgroup BUS_LL_EC_AHB2_GRP1_PERIPH AHB2 GRP1 PERIPH
  96. * @{
  97. */
  98. #define LL_AHB2_GRP1_PERIPH_ALL 0xFFFFFFFFU
  99. #define LL_AHB2_GRP1_PERIPH_GPIOA RCC_AHB2ENR_GPIOAEN
  100. #define LL_AHB2_GRP1_PERIPH_GPIOB RCC_AHB2ENR_GPIOBEN
  101. #define LL_AHB2_GRP1_PERIPH_GPIOC RCC_AHB2ENR_GPIOCEN
  102. #if defined(GPIOD)
  103. #define LL_AHB2_GRP1_PERIPH_GPIOD RCC_AHB2ENR_GPIODEN
  104. #endif /*GPIOD*/
  105. #if defined(GPIOE)
  106. #define LL_AHB2_GRP1_PERIPH_GPIOE RCC_AHB2ENR_GPIOEEN
  107. #endif /*GPIOE*/
  108. #if defined(GPIOF)
  109. #define LL_AHB2_GRP1_PERIPH_GPIOF RCC_AHB2ENR_GPIOFEN
  110. #endif /* GPIOF */
  111. #if defined(GPIOG)
  112. #define LL_AHB2_GRP1_PERIPH_GPIOG RCC_AHB2ENR_GPIOGEN
  113. #endif /* GPIOG */
  114. #define LL_AHB2_GRP1_PERIPH_GPIOH RCC_AHB2ENR_GPIOHEN
  115. #if defined(GPIOI)
  116. #define LL_AHB2_GRP1_PERIPH_GPIOI RCC_AHB2ENR_GPIOIEN
  117. #endif /* GPIOI */
  118. #if defined(USB_OTG_FS)
  119. #define LL_AHB2_GRP1_PERIPH_OTGFS RCC_AHB2ENR_OTGFSEN
  120. #endif /* USB_OTG_FS */
  121. #define LL_AHB2_GRP1_PERIPH_ADC RCC_AHB2ENR_ADCEN
  122. #if defined(DCMI)
  123. #define LL_AHB2_GRP1_PERIPH_DCMI RCC_AHB2ENR_DCMIEN
  124. #endif /* DCMI */
  125. #if defined(AES)
  126. #define LL_AHB2_GRP1_PERIPH_AES RCC_AHB2ENR_AESEN
  127. #endif /* AES */
  128. #if defined(HASH)
  129. #define LL_AHB2_GRP1_PERIPH_HASH RCC_AHB2ENR_HASHEN
  130. #endif /* HASH */
  131. #define LL_AHB2_GRP1_PERIPH_RNG RCC_AHB2ENR_RNGEN
  132. #if defined(OCTOSPIM)
  133. #define LL_AHB2_GRP1_PERIPH_OSPIM RCC_AHB2ENR_OSPIMEN
  134. #endif /* OCTOSPIM */
  135. #if defined(SDMMC1) && defined(RCC_AHB2ENR_SDMMC1EN)
  136. #define LL_AHB2_GRP1_PERIPH_SDMMC1 RCC_AHB2ENR_SDMMC1EN
  137. #endif /* SDMMC1 && RCC_AHB2ENR_SDMMC1EN */
  138. #define LL_AHB2_GRP1_PERIPH_SRAM2 RCC_AHB2SMENR_SRAM2SMEN
  139. #if defined(SRAM3_BASE)
  140. #define LL_AHB2_GRP1_PERIPH_SRAM3 RCC_AHB2SMENR_SRAM3SMEN
  141. #endif /* SRAM3_BASE */
  142. /**
  143. * @}
  144. */
  145. /** @defgroup BUS_LL_EC_AHB3_GRP1_PERIPH AHB3 GRP1 PERIPH
  146. * @{
  147. */
  148. #define LL_AHB3_GRP1_PERIPH_ALL 0xFFFFFFFFU
  149. #if defined(FMC_Bank1_R)
  150. #define LL_AHB3_GRP1_PERIPH_FMC RCC_AHB3ENR_FMCEN
  151. #endif /* FMC_Bank1_R */
  152. #if defined(QUADSPI)
  153. #define LL_AHB3_GRP1_PERIPH_QSPI RCC_AHB3ENR_QSPIEN
  154. #endif /* QUADSPI */
  155. #if defined(OCTOSPI1)
  156. #define LL_AHB3_GRP1_PERIPH_OSPI1 RCC_AHB3ENR_OSPI1EN
  157. #endif /* OCTOSPI1 */
  158. #if defined(OCTOSPI2)
  159. #define LL_AHB3_GRP1_PERIPH_OSPI2 RCC_AHB3ENR_OSPI2EN
  160. #endif /* OCTOSPI2 */
  161. /**
  162. * @}
  163. */
  164. /** @defgroup BUS_LL_EC_APB1_GRP1_PERIPH APB1 GRP1 PERIPH
  165. * @{
  166. */
  167. #define LL_APB1_GRP1_PERIPH_ALL 0xFFFFFFFFU
  168. #define LL_APB1_GRP1_PERIPH_TIM2 RCC_APB1ENR1_TIM2EN
  169. #if defined(TIM3)
  170. #define LL_APB1_GRP1_PERIPH_TIM3 RCC_APB1ENR1_TIM3EN
  171. #endif /* TIM3 */
  172. #if defined(TIM4)
  173. #define LL_APB1_GRP1_PERIPH_TIM4 RCC_APB1ENR1_TIM4EN
  174. #endif /* TIM4 */
  175. #if defined(TIM5)
  176. #define LL_APB1_GRP1_PERIPH_TIM5 RCC_APB1ENR1_TIM5EN
  177. #endif /* TIM5 */
  178. #define LL_APB1_GRP1_PERIPH_TIM6 RCC_APB1ENR1_TIM6EN
  179. #define LL_APB1_GRP1_PERIPH_TIM7 RCC_APB1ENR1_TIM7EN
  180. #if defined(LCD)
  181. #define LL_APB1_GRP1_PERIPH_LCD RCC_APB1ENR1_LCDEN
  182. #endif /* LCD */
  183. #if defined(RCC_APB1ENR1_RTCAPBEN)
  184. #define LL_APB1_GRP1_PERIPH_RTCAPB RCC_APB1ENR1_RTCAPBEN
  185. #endif /* RCC_APB1ENR1_RTCAPBEN */
  186. #define LL_APB1_GRP1_PERIPH_WWDG RCC_APB1ENR1_WWDGEN
  187. #if defined(SPI2)
  188. #define LL_APB1_GRP1_PERIPH_SPI2 RCC_APB1ENR1_SPI2EN
  189. #endif /* SPI2 */
  190. #define LL_APB1_GRP1_PERIPH_SPI3 RCC_APB1ENR1_SPI3EN
  191. #define LL_APB1_GRP1_PERIPH_USART2 RCC_APB1ENR1_USART2EN
  192. #if defined(USART3)
  193. #define LL_APB1_GRP1_PERIPH_USART3 RCC_APB1ENR1_USART3EN
  194. #endif /* USART3 */
  195. #if defined(UART4)
  196. #define LL_APB1_GRP1_PERIPH_UART4 RCC_APB1ENR1_UART4EN
  197. #endif /* UART4 */
  198. #if defined(UART5)
  199. #define LL_APB1_GRP1_PERIPH_UART5 RCC_APB1ENR1_UART5EN
  200. #endif /* UART5 */
  201. #define LL_APB1_GRP1_PERIPH_I2C1 RCC_APB1ENR1_I2C1EN
  202. #if defined(I2C2)
  203. #define LL_APB1_GRP1_PERIPH_I2C2 RCC_APB1ENR1_I2C2EN
  204. #endif /* I2C2 */
  205. #define LL_APB1_GRP1_PERIPH_I2C3 RCC_APB1ENR1_I2C3EN
  206. #if defined(CRS)
  207. #define LL_APB1_GRP1_PERIPH_CRS RCC_APB1ENR1_CRSEN
  208. #endif /* CRS */
  209. #define LL_APB1_GRP1_PERIPH_CAN1 RCC_APB1ENR1_CAN1EN
  210. #if defined(CAN2)
  211. #define LL_APB1_GRP1_PERIPH_CAN2 RCC_APB1ENR1_CAN2EN
  212. #endif /* CAN2 */
  213. #if defined(USB)
  214. #define LL_APB1_GRP1_PERIPH_USB RCC_APB1ENR1_USBFSEN
  215. #endif /* USB */
  216. #define LL_APB1_GRP1_PERIPH_PWR RCC_APB1ENR1_PWREN
  217. #define LL_APB1_GRP1_PERIPH_DAC1 RCC_APB1ENR1_DAC1EN
  218. #define LL_APB1_GRP1_PERIPH_OPAMP RCC_APB1ENR1_OPAMPEN
  219. #define LL_APB1_GRP1_PERIPH_LPTIM1 RCC_APB1ENR1_LPTIM1EN
  220. /**
  221. * @}
  222. */
  223. /** @defgroup BUS_LL_EC_APB1_GRP2_PERIPH APB1 GRP2 PERIPH
  224. * @{
  225. */
  226. #define LL_APB1_GRP2_PERIPH_ALL 0xFFFFFFFFU
  227. #define LL_APB1_GRP2_PERIPH_LPUART1 RCC_APB1ENR2_LPUART1EN
  228. #if defined(I2C4)
  229. #define LL_APB1_GRP2_PERIPH_I2C4 RCC_APB1ENR2_I2C4EN
  230. #endif /* I2C4 */
  231. #if defined(SWPMI1)
  232. #define LL_APB1_GRP2_PERIPH_SWPMI1 RCC_APB1ENR2_SWPMI1EN
  233. #endif /* SWPMI1 */
  234. #define LL_APB1_GRP2_PERIPH_LPTIM2 RCC_APB1ENR2_LPTIM2EN
  235. /**
  236. * @}
  237. */
  238. /** @defgroup BUS_LL_EC_APB2_GRP1_PERIPH APB2 GRP1 PERIPH
  239. * @{
  240. */
  241. #define LL_APB2_GRP1_PERIPH_ALL 0xFFFFFFFFU
  242. #define LL_APB2_GRP1_PERIPH_SYSCFG RCC_APB2ENR_SYSCFGEN
  243. #define LL_APB2_GRP1_PERIPH_FW RCC_APB2ENR_FWEN
  244. #if defined(SDMMC1) && defined(RCC_APB2ENR_SDMMC1EN)
  245. #define LL_APB2_GRP1_PERIPH_SDMMC1 RCC_APB2ENR_SDMMC1EN
  246. #endif /* SDMMC1 && RCC_APB2ENR_SDMMC1EN */
  247. #define LL_APB2_GRP1_PERIPH_TIM1 RCC_APB2ENR_TIM1EN
  248. #define LL_APB2_GRP1_PERIPH_SPI1 RCC_APB2ENR_SPI1EN
  249. #if defined(TIM8)
  250. #define LL_APB2_GRP1_PERIPH_TIM8 RCC_APB2ENR_TIM8EN
  251. #endif /* TIM8 */
  252. #define LL_APB2_GRP1_PERIPH_USART1 RCC_APB2ENR_USART1EN
  253. #define LL_APB2_GRP1_PERIPH_TIM15 RCC_APB2ENR_TIM15EN
  254. #define LL_APB2_GRP1_PERIPH_TIM16 RCC_APB2ENR_TIM16EN
  255. #if defined(TIM17)
  256. #define LL_APB2_GRP1_PERIPH_TIM17 RCC_APB2ENR_TIM17EN
  257. #endif /* TIM17 */
  258. #define LL_APB2_GRP1_PERIPH_SAI1 RCC_APB2ENR_SAI1EN
  259. #if defined(SAI2)
  260. #define LL_APB2_GRP1_PERIPH_SAI2 RCC_APB2ENR_SAI2EN
  261. #endif /* SAI2 */
  262. #if defined(DFSDM1_Channel0)
  263. #define LL_APB2_GRP1_PERIPH_DFSDM1 RCC_APB2ENR_DFSDM1EN
  264. #endif /* DFSDM1_Channel0 */
  265. #if defined(LTDC)
  266. #define LL_APB2_GRP1_PERIPH_LTDC RCC_APB2ENR_LTDCEN
  267. #endif /* LTDC */
  268. #if defined(DSI)
  269. #define LL_APB2_GRP1_PERIPH_DSI RCC_APB2ENR_DSIEN
  270. #endif /* DSI */
  271. /**
  272. * @}
  273. */
  274. /** Legacy definitions for compatibility purpose
  275. @cond 0
  276. */
  277. #if defined(DFSDM1_Channel0)
  278. #define LL_APB2_GRP1_PERIPH_DFSDM LL_APB2_GRP1_PERIPH_DFSDM1
  279. #endif /* DFSDM1_Channel0 */
  280. /**
  281. @endcond
  282. */
  283. /**
  284. * @}
  285. */
  286. /* Exported macro ------------------------------------------------------------*/
  287. /* Exported functions --------------------------------------------------------*/
  288. /** @defgroup BUS_LL_Exported_Functions BUS Exported Functions
  289. * @{
  290. */
  291. /** @defgroup BUS_LL_EF_AHB1 AHB1
  292. * @{
  293. */
  294. /**
  295. * @brief Enable AHB1 peripherals clock.
  296. * @rmtoll AHB1ENR DMA1EN LL_AHB1_GRP1_EnableClock\n
  297. * AHB1ENR DMA2EN LL_AHB1_GRP1_EnableClock\n
  298. * AHB1ENR DMAMUX1EN LL_AHB1_GRP1_EnableClock\n
  299. * AHB1ENR FLASHEN LL_AHB1_GRP1_EnableClock\n
  300. * AHB1ENR CRCEN LL_AHB1_GRP1_EnableClock\n
  301. * AHB1ENR TSCEN LL_AHB1_GRP1_EnableClock\n
  302. * AHB1ENR DMA2DEN LL_AHB1_GRP1_EnableClock\n
  303. * AHB1ENR GFXMMUEN LL_AHB1_GRP1_EnableClock
  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_DMA2
  307. * @arg @ref LL_AHB1_GRP1_PERIPH_DMAMUX1 (*)
  308. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  309. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  310. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC
  311. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2D (*)
  312. * @arg @ref LL_AHB1_GRP1_PERIPH_GFXMMU (*)
  313. *
  314. * (*) value not defined in all devices.
  315. * @retval None
  316. */
  317. __STATIC_INLINE void LL_AHB1_GRP1_EnableClock(uint32_t Periphs)
  318. {
  319. __IO uint32_t tmpreg;
  320. SET_BIT(RCC->AHB1ENR, Periphs);
  321. /* Delay after an RCC peripheral clock enabling */
  322. tmpreg = READ_BIT(RCC->AHB1ENR, Periphs);
  323. (void)tmpreg;
  324. }
  325. /**
  326. * @brief Check if AHB1 peripheral clock is enabled or not
  327. * @rmtoll AHB1ENR DMA1EN LL_AHB1_GRP1_IsEnabledClock\n
  328. * AHB1ENR DMA2EN LL_AHB1_GRP1_IsEnabledClock\n
  329. * AHB1ENR DMAMUX1EN LL_AHB1_GRP1_IsEnabledClock\n
  330. * AHB1ENR FLASHEN LL_AHB1_GRP1_IsEnabledClock\n
  331. * AHB1ENR CRCEN LL_AHB1_GRP1_IsEnabledClock\n
  332. * AHB1ENR TSCEN LL_AHB1_GRP1_IsEnabledClock\n
  333. * AHB1ENR DMA2DEN LL_AHB1_GRP1_IsEnabledClock\n
  334. * AHB1ENR GFXMMUEN LL_AHB1_GRP1_IsEnabledClock
  335. * @param Periphs This parameter can be a combination of the following values:
  336. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  337. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2
  338. * @arg @ref LL_AHB1_GRP1_PERIPH_DMAMUX1 (*)
  339. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  340. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  341. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC
  342. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2D (*)
  343. * @arg @ref LL_AHB1_GRP1_PERIPH_GFXMMU (*)
  344. *
  345. * (*) value not defined in all devices.
  346. * @retval State of Periphs (1 or 0).
  347. */
  348. __STATIC_INLINE uint32_t LL_AHB1_GRP1_IsEnabledClock(uint32_t Periphs)
  349. {
  350. return (READ_BIT(RCC->AHB1ENR, Periphs) == Periphs);
  351. }
  352. /**
  353. * @brief Disable AHB1 peripherals clock.
  354. * @rmtoll AHB1ENR DMA1EN LL_AHB1_GRP1_DisableClock\n
  355. * AHB1ENR DMA2EN LL_AHB1_GRP1_DisableClock\n
  356. * AHB1ENR DMAMUX1EN LL_AHB1_GRP1_DisableClock\n
  357. * AHB1ENR FLASHEN LL_AHB1_GRP1_DisableClock\n
  358. * AHB1ENR CRCEN LL_AHB1_GRP1_DisableClock\n
  359. * AHB1ENR TSCEN LL_AHB1_GRP1_DisableClock\n
  360. * AHB1ENR DMA2DEN LL_AHB1_GRP1_DisableClock\n
  361. * AHB1ENR GFXMMUEN LL_AHB1_GRP1_DisableClock
  362. * @param Periphs This parameter can be a combination of the following values:
  363. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  364. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2
  365. * @arg @ref LL_AHB1_GRP1_PERIPH_DMAMUX1 (*)
  366. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  367. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  368. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC
  369. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2D (*)
  370. * @arg @ref LL_AHB1_GRP1_PERIPH_GFXMMU (*)
  371. *
  372. * (*) value not defined in all devices.
  373. * @retval None
  374. */
  375. __STATIC_INLINE void LL_AHB1_GRP1_DisableClock(uint32_t Periphs)
  376. {
  377. CLEAR_BIT(RCC->AHB1ENR, Periphs);
  378. }
  379. /**
  380. * @brief Force AHB1 peripherals reset.
  381. * @rmtoll AHB1RSTR DMA1RST LL_AHB1_GRP1_ForceReset\n
  382. * AHB1RSTR DMA2RST LL_AHB1_GRP1_ForceReset\n
  383. * AHB1RSTR DMAMUX1RST LL_AHB1_GRP1_ForceReset\n
  384. * AHB1RSTR FLASHRST LL_AHB1_GRP1_ForceReset\n
  385. * AHB1RSTR CRCRST LL_AHB1_GRP1_ForceReset\n
  386. * AHB1RSTR TSCRST LL_AHB1_GRP1_ForceReset\n
  387. * AHB1RSTR DMA2DRST LL_AHB1_GRP1_ForceReset\n
  388. * AHB1RSTR GFXMMURST LL_AHB1_GRP1_ForceReset
  389. * @param Periphs This parameter can be a combination of the following values:
  390. * @arg @ref LL_AHB1_GRP1_PERIPH_ALL
  391. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  392. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2
  393. * @arg @ref LL_AHB1_GRP1_PERIPH_DMAMUX1 (*)
  394. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  395. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  396. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC
  397. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2D (*)
  398. * @arg @ref LL_AHB1_GRP1_PERIPH_GFXMMU (*)
  399. *
  400. * (*) value not defined in all devices.
  401. * @retval None
  402. */
  403. __STATIC_INLINE void LL_AHB1_GRP1_ForceReset(uint32_t Periphs)
  404. {
  405. SET_BIT(RCC->AHB1RSTR, Periphs);
  406. }
  407. /**
  408. * @brief Release AHB1 peripherals reset.
  409. * @rmtoll AHB1RSTR DMA1RST LL_AHB1_GRP1_ReleaseReset\n
  410. * AHB1RSTR DMA2RST LL_AHB1_GRP1_ReleaseReset\n
  411. * AHB1RSTR DMAMUX1RST LL_AHB1_GRP1_ReleaseReset\n
  412. * AHB1RSTR FLASHRST LL_AHB1_GRP1_ReleaseReset\n
  413. * AHB1RSTR CRCRST LL_AHB1_GRP1_ReleaseReset\n
  414. * AHB1RSTR TSCRST LL_AHB1_GRP1_ReleaseReset\n
  415. * AHB1RSTR DMA2DRST LL_AHB1_GRP1_ReleaseReset\n
  416. * AHB1RSTR GFXMMURST LL_AHB1_GRP1_ReleaseReset
  417. * @param Periphs This parameter can be a combination of the following values:
  418. * @arg @ref LL_AHB1_GRP1_PERIPH_ALL
  419. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  420. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2
  421. * @arg @ref LL_AHB1_GRP1_PERIPH_DMAMUX1 (*)
  422. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  423. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  424. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC
  425. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2D (*)
  426. * @arg @ref LL_AHB1_GRP1_PERIPH_GFXMMU (*)
  427. *
  428. * (*) value not defined in all devices.
  429. * @retval None
  430. */
  431. __STATIC_INLINE void LL_AHB1_GRP1_ReleaseReset(uint32_t Periphs)
  432. {
  433. CLEAR_BIT(RCC->AHB1RSTR, Periphs);
  434. }
  435. /**
  436. * @brief Enable AHB1 peripheral clocks in Sleep and Stop modes
  437. * @rmtoll AHB1SMENR DMA1SMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  438. * AHB1SMENR DMA2SMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  439. * AHB1SMENR DMAMUX1SMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  440. * AHB1SMENR FLASHSMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  441. * AHB1SMENR SRAM1SMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  442. * AHB1SMENR CRCSMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  443. * AHB1SMENR TSCSMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  444. * AHB1SMENR DMA2DSMEN LL_AHB1_GRP1_EnableClockStopSleep\n
  445. * AHB1SMENR GFXMMUSMEN LL_AHB1_GRP1_EnableClockStopSleep
  446. * @param Periphs This parameter can be a combination of the following values:
  447. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  448. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2
  449. * @arg @ref LL_AHB1_GRP1_PERIPH_DMAMUX1 (*)
  450. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  451. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM1
  452. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  453. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC
  454. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2D (*)
  455. * @arg @ref LL_AHB1_GRP1_PERIPH_GFXMMU (*)
  456. *
  457. * (*) value not defined in all devices.
  458. * @retval None
  459. */
  460. __STATIC_INLINE void LL_AHB1_GRP1_EnableClockStopSleep(uint32_t Periphs)
  461. {
  462. __IO uint32_t tmpreg;
  463. SET_BIT(RCC->AHB1SMENR, Periphs);
  464. /* Delay after an RCC peripheral clock enabling */
  465. tmpreg = READ_BIT(RCC->AHB1SMENR, Periphs);
  466. (void)tmpreg;
  467. }
  468. /**
  469. * @brief Disable AHB1 peripheral clocks in Sleep and Stop modes
  470. * @rmtoll AHB1SMENR DMA1SMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  471. * AHB1SMENR DMA2SMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  472. * AHB1SMENR DMAMUX1SMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  473. * AHB1SMENR FLASHSMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  474. * AHB1SMENR SRAM1SMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  475. * AHB1SMENR CRCSMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  476. * AHB1SMENR TSCSMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  477. * AHB1SMENR DMA2DSMEN LL_AHB1_GRP1_DisableClockStopSleep\n
  478. * AHB1SMENR GFXMMUSMEN LL_AHB1_GRP1_DisableClockStopSleep
  479. * @param Periphs This parameter can be a combination of the following values:
  480. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1
  481. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2
  482. * @arg @ref LL_AHB1_GRP1_PERIPH_DMAMUX1 (*)
  483. * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH
  484. * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM1
  485. * @arg @ref LL_AHB1_GRP1_PERIPH_CRC
  486. * @arg @ref LL_AHB1_GRP1_PERIPH_TSC
  487. * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2D (*)
  488. * @arg @ref LL_AHB1_GRP1_PERIPH_GFXMMU (*)
  489. *
  490. * (*) value not defined in all devices.
  491. * @retval None
  492. */
  493. __STATIC_INLINE void LL_AHB1_GRP1_DisableClockStopSleep(uint32_t Periphs)
  494. {
  495. CLEAR_BIT(RCC->AHB1SMENR, Periphs);
  496. }
  497. /**
  498. * @}
  499. */
  500. /** @defgroup BUS_LL_EF_AHB2 AHB2
  501. * @{
  502. */
  503. /**
  504. * @brief Enable AHB2 peripherals clock.
  505. * @rmtoll AHB2ENR GPIOAEN LL_AHB2_GRP1_EnableClock\n
  506. * AHB2ENR GPIOBEN LL_AHB2_GRP1_EnableClock\n
  507. * AHB2ENR GPIOCEN LL_AHB2_GRP1_EnableClock\n
  508. * AHB2ENR GPIODEN LL_AHB2_GRP1_EnableClock\n
  509. * AHB2ENR GPIOEEN LL_AHB2_GRP1_EnableClock\n
  510. * AHB2ENR GPIOFEN LL_AHB2_GRP1_EnableClock\n
  511. * AHB2ENR GPIOGEN LL_AHB2_GRP1_EnableClock\n
  512. * AHB2ENR GPIOHEN LL_AHB2_GRP1_EnableClock\n
  513. * AHB2ENR GPIOIEN LL_AHB2_GRP1_EnableClock\n
  514. * AHB2ENR OTGFSEN LL_AHB2_GRP1_EnableClock\n
  515. * AHB2ENR ADCEN LL_AHB2_GRP1_EnableClock\n
  516. * AHB2ENR DCMIEN LL_AHB2_GRP1_EnableClock\n
  517. * AHB2ENR AESEN LL_AHB2_GRP1_EnableClock\n
  518. * AHB2ENR HASHEN LL_AHB2_GRP1_EnableClock\n
  519. * AHB2ENR RNGEN LL_AHB2_GRP1_EnableClock\n
  520. * AHB2ENR OSPIMEN LL_AHB2_GRP1_EnableClock\n
  521. * AHB2ENR SDMMC1EN LL_AHB2_GRP1_EnableClock
  522. * @param Periphs This parameter can be a combination of the following values:
  523. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOA
  524. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOB
  525. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOC
  526. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOD (*)
  527. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOE (*)
  528. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOF (*)
  529. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOG (*)
  530. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOH
  531. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOI (*)
  532. * @arg @ref LL_AHB2_GRP1_PERIPH_OTGFS (*)
  533. * @arg @ref LL_AHB2_GRP1_PERIPH_ADC
  534. * @arg @ref LL_AHB2_GRP1_PERIPH_DCMI (*)
  535. * @arg @ref LL_AHB2_GRP1_PERIPH_AES (*)
  536. * @arg @ref LL_AHB2_GRP1_PERIPH_HASH (*)
  537. * @arg @ref LL_AHB2_GRP1_PERIPH_RNG
  538. * @arg @ref LL_AHB2_GRP1_PERIPH_OSPIM (*)
  539. * @arg @ref LL_AHB2_GRP1_PERIPH_SDMMC1 (*)
  540. *
  541. * (*) value not defined in all devices.
  542. * @retval None
  543. */
  544. __STATIC_INLINE void LL_AHB2_GRP1_EnableClock(uint32_t Periphs)
  545. {
  546. __IO uint32_t tmpreg;
  547. SET_BIT(RCC->AHB2ENR, Periphs);
  548. /* Delay after an RCC peripheral clock enabling */
  549. tmpreg = READ_BIT(RCC->AHB2ENR, Periphs);
  550. (void)tmpreg;
  551. }
  552. /**
  553. * @brief Check if AHB2 peripheral clock is enabled or not
  554. * @rmtoll AHB2ENR GPIOAEN LL_AHB2_GRP1_IsEnabledClock\n
  555. * AHB2ENR GPIOBEN LL_AHB2_GRP1_IsEnabledClock\n
  556. * AHB2ENR GPIOCEN LL_AHB2_GRP1_IsEnabledClock\n
  557. * AHB2ENR GPIODEN LL_AHB2_GRP1_IsEnabledClock\n
  558. * AHB2ENR GPIOEEN LL_AHB2_GRP1_IsEnabledClock\n
  559. * AHB2ENR GPIOFEN LL_AHB2_GRP1_IsEnabledClock\n
  560. * AHB2ENR GPIOGEN LL_AHB2_GRP1_IsEnabledClock\n
  561. * AHB2ENR GPIOHEN LL_AHB2_GRP1_IsEnabledClock\n
  562. * AHB2ENR GPIOIEN LL_AHB2_GRP1_IsEnabledClock\n
  563. * AHB2ENR OTGFSEN LL_AHB2_GRP1_IsEnabledClock\n
  564. * AHB2ENR ADCEN LL_AHB2_GRP1_IsEnabledClock\n
  565. * AHB2ENR DCMIEN LL_AHB2_GRP1_IsEnabledClock\n
  566. * AHB2ENR AESEN LL_AHB2_GRP1_IsEnabledClock\n
  567. * AHB2ENR HASHEN LL_AHB2_GRP1_IsEnabledClock\n
  568. * AHB2ENR RNGEN LL_AHB2_GRP1_IsEnabledClock\n
  569. * AHB2ENR OSPIMEN LL_AHB2_GRP1_IsEnabledClock\n
  570. * AHB2ENR SDMMC1EN LL_AHB2_GRP1_IsEnabledClock
  571. * @param Periphs This parameter can be a combination of the following values:
  572. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOA
  573. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOB
  574. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOC
  575. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOD (*)
  576. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOE (*)
  577. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOF (*)
  578. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOG (*)
  579. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOH
  580. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOI (*)
  581. * @arg @ref LL_AHB2_GRP1_PERIPH_OTGFS (*)
  582. * @arg @ref LL_AHB2_GRP1_PERIPH_ADC
  583. * @arg @ref LL_AHB2_GRP1_PERIPH_DCMI (*)
  584. * @arg @ref LL_AHB2_GRP1_PERIPH_AES (*)
  585. * @arg @ref LL_AHB2_GRP1_PERIPH_HASH (*)
  586. * @arg @ref LL_AHB2_GRP1_PERIPH_RNG
  587. * @arg @ref LL_AHB2_GRP1_PERIPH_OSPIM (*)
  588. * @arg @ref LL_AHB2_GRP1_PERIPH_SDMMC1 (*)
  589. *
  590. * (*) value not defined in all devices.
  591. * @retval State of Periphs (1 or 0).
  592. */
  593. __STATIC_INLINE uint32_t LL_AHB2_GRP1_IsEnabledClock(uint32_t Periphs)
  594. {
  595. return (READ_BIT(RCC->AHB2ENR, Periphs) == Periphs);
  596. }
  597. /**
  598. * @brief Disable AHB2 peripherals clock.
  599. * @rmtoll AHB2ENR GPIOAEN LL_AHB2_GRP1_DisableClock\n
  600. * AHB2ENR GPIOBEN LL_AHB2_GRP1_DisableClock\n
  601. * AHB2ENR GPIOCEN LL_AHB2_GRP1_DisableClock\n
  602. * AHB2ENR GPIODEN LL_AHB2_GRP1_DisableClock\n
  603. * AHB2ENR GPIOEEN LL_AHB2_GRP1_DisableClock\n
  604. * AHB2ENR GPIOFEN LL_AHB2_GRP1_DisableClock\n
  605. * AHB2ENR GPIOGEN LL_AHB2_GRP1_DisableClock\n
  606. * AHB2ENR GPIOHEN LL_AHB2_GRP1_DisableClock\n
  607. * AHB2ENR GPIOIEN LL_AHB2_GRP1_DisableClock\n
  608. * AHB2ENR OTGFSEN LL_AHB2_GRP1_DisableClock\n
  609. * AHB2ENR ADCEN LL_AHB2_GRP1_DisableClock\n
  610. * AHB2ENR DCMIEN LL_AHB2_GRP1_DisableClock\n
  611. * AHB2ENR AESEN LL_AHB2_GRP1_DisableClock\n
  612. * AHB2ENR HASHEN LL_AHB2_GRP1_DisableClock\n
  613. * AHB2ENR RNGEN LL_AHB2_GRP1_DisableClock\n
  614. * AHB2ENR OSPIMEN LL_AHB2_GRP1_DisableClock\n
  615. * AHB2ENR SDMMC1EN LL_AHB2_GRP1_DisableClock
  616. * @param Periphs This parameter can be a combination of the following values:
  617. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOA
  618. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOB
  619. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOC
  620. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOD (*)
  621. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOE (*)
  622. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOF (*)
  623. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOG (*)
  624. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOH
  625. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOI (*)
  626. * @arg @ref LL_AHB2_GRP1_PERIPH_OTGFS (*)
  627. * @arg @ref LL_AHB2_GRP1_PERIPH_ADC
  628. * @arg @ref LL_AHB2_GRP1_PERIPH_DCMI (*)
  629. * @arg @ref LL_AHB2_GRP1_PERIPH_AES (*)
  630. * @arg @ref LL_AHB2_GRP1_PERIPH_HASH (*)
  631. * @arg @ref LL_AHB2_GRP1_PERIPH_RNG
  632. * @arg @ref LL_AHB2_GRP1_PERIPH_OSPIM (*)
  633. * @arg @ref LL_AHB2_GRP1_PERIPH_SDMMC1 (*)
  634. *
  635. * (*) value not defined in all devices.
  636. * @retval None
  637. */
  638. __STATIC_INLINE void LL_AHB2_GRP1_DisableClock(uint32_t Periphs)
  639. {
  640. CLEAR_BIT(RCC->AHB2ENR, Periphs);
  641. }
  642. /**
  643. * @brief Force AHB2 peripherals reset.
  644. * @rmtoll AHB2RSTR GPIOARST LL_AHB2_GRP1_ForceReset\n
  645. * AHB2RSTR GPIOBRST LL_AHB2_GRP1_ForceReset\n
  646. * AHB2RSTR GPIOCRST LL_AHB2_GRP1_ForceReset\n
  647. * AHB2RSTR GPIODRST LL_AHB2_GRP1_ForceReset\n
  648. * AHB2RSTR GPIOERST LL_AHB2_GRP1_ForceReset\n
  649. * AHB2RSTR GPIOFRST LL_AHB2_GRP1_ForceReset\n
  650. * AHB2RSTR GPIOGRST LL_AHB2_GRP1_ForceReset\n
  651. * AHB2RSTR GPIOHRST LL_AHB2_GRP1_ForceReset\n
  652. * AHB2RSTR GPIOIRST LL_AHB2_GRP1_ForceReset\n
  653. * AHB2RSTR OTGFSRST LL_AHB2_GRP1_ForceReset\n
  654. * AHB2RSTR ADCRST LL_AHB2_GRP1_ForceReset\n
  655. * AHB2RSTR DCMIRST LL_AHB2_GRP1_ForceReset\n
  656. * AHB2RSTR AESRST LL_AHB2_GRP1_ForceReset\n
  657. * AHB2RSTR HASHRST LL_AHB2_GRP1_ForceReset\n
  658. * AHB2RSTR RNGRST LL_AHB2_GRP1_ForceReset\n
  659. * AHB2RSTR OSPIMRST LL_AHB2_GRP1_ForceReset\n
  660. * AHB2RSTR SDMMC1RST LL_AHB2_GRP1_ForceReset
  661. * @param Periphs This parameter can be a combination of the following values:
  662. * @arg @ref LL_AHB2_GRP1_PERIPH_ALL
  663. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOA
  664. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOB
  665. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOC
  666. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOD (*)
  667. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOE (*)
  668. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOF (*)
  669. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOG (*)
  670. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOH
  671. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOI (*)
  672. * @arg @ref LL_AHB2_GRP1_PERIPH_OTGFS (*)
  673. * @arg @ref LL_AHB2_GRP1_PERIPH_ADC
  674. * @arg @ref LL_AHB2_GRP1_PERIPH_DCMI (*)
  675. * @arg @ref LL_AHB2_GRP1_PERIPH_AES (*)
  676. * @arg @ref LL_AHB2_GRP1_PERIPH_HASH (*)
  677. * @arg @ref LL_AHB2_GRP1_PERIPH_RNG
  678. * @arg @ref LL_AHB2_GRP1_PERIPH_OSPIM (*)
  679. * @arg @ref LL_AHB2_GRP1_PERIPH_SDMMC1 (*)
  680. *
  681. * (*) value not defined in all devices.
  682. * @retval None
  683. */
  684. __STATIC_INLINE void LL_AHB2_GRP1_ForceReset(uint32_t Periphs)
  685. {
  686. SET_BIT(RCC->AHB2RSTR, Periphs);
  687. }
  688. /**
  689. * @brief Release AHB2 peripherals reset.
  690. * @rmtoll AHB2RSTR GPIOARST LL_AHB2_GRP1_ReleaseReset\n
  691. * AHB2RSTR GPIOBRST LL_AHB2_GRP1_ReleaseReset\n
  692. * AHB2RSTR GPIOCRST LL_AHB2_GRP1_ReleaseReset\n
  693. * AHB2RSTR GPIODRST LL_AHB2_GRP1_ReleaseReset\n
  694. * AHB2RSTR GPIOERST LL_AHB2_GRP1_ReleaseReset\n
  695. * AHB2RSTR GPIOFRST LL_AHB2_GRP1_ReleaseReset\n
  696. * AHB2RSTR GPIOGRST LL_AHB2_GRP1_ReleaseReset\n
  697. * AHB2RSTR GPIOHRST LL_AHB2_GRP1_ReleaseReset\n
  698. * AHB2RSTR GPIOIRST LL_AHB2_GRP1_ReleaseReset\n
  699. * AHB2RSTR OTGFSRST LL_AHB2_GRP1_ReleaseReset\n
  700. * AHB2RSTR ADCRST LL_AHB2_GRP1_ReleaseReset\n
  701. * AHB2RSTR DCMIRST LL_AHB2_GRP1_ReleaseReset\n
  702. * AHB2RSTR AESRST LL_AHB2_GRP1_ReleaseReset\n
  703. * AHB2RSTR HASHRST LL_AHB2_GRP1_ReleaseReset\n
  704. * AHB2RSTR RNGRST LL_AHB2_GRP1_ReleaseReset\n
  705. * AHB2RSTR OSPIMRST LL_AHB2_GRP1_ReleaseReset\n
  706. * AHB2RSTR SDMMC1RST LL_AHB2_GRP1_ReleaseReset
  707. * @param Periphs This parameter can be a combination of the following values:
  708. * @arg @ref LL_AHB2_GRP1_PERIPH_ALL
  709. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOA
  710. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOB
  711. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOC
  712. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOD (*)
  713. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOE (*)
  714. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOF (*)
  715. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOG (*)
  716. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOH
  717. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOI (*)
  718. * @arg @ref LL_AHB2_GRP1_PERIPH_OTGFS (*)
  719. * @arg @ref LL_AHB2_GRP1_PERIPH_ADC
  720. * @arg @ref LL_AHB2_GRP1_PERIPH_DCMI (*)
  721. * @arg @ref LL_AHB2_GRP1_PERIPH_AES (*)
  722. * @arg @ref LL_AHB2_GRP1_PERIPH_HASH (*)
  723. * @arg @ref LL_AHB2_GRP1_PERIPH_RNG
  724. * @arg @ref LL_AHB2_GRP1_PERIPH_OSPIM (*)
  725. * @arg @ref LL_AHB2_GRP1_PERIPH_SDMMC1 (*)
  726. *
  727. * (*) value not defined in all devices.
  728. * @retval None
  729. */
  730. __STATIC_INLINE void LL_AHB2_GRP1_ReleaseReset(uint32_t Periphs)
  731. {
  732. CLEAR_BIT(RCC->AHB2RSTR, Periphs);
  733. }
  734. /**
  735. * @brief Enable AHB2 peripheral clocks in Sleep and Stop modes
  736. * @rmtoll AHB2SMENR GPIOASMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  737. * AHB2SMENR GPIOBSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  738. * AHB2SMENR GPIOCSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  739. * AHB2SMENR GPIODSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  740. * AHB2SMENR GPIOESMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  741. * AHB2SMENR GPIOFSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  742. * AHB2SMENR GPIOGSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  743. * AHB2SMENR GPIOHSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  744. * AHB2SMENR GPIOISMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  745. * AHB2SMENR SRAM2SMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  746. * AHB2SMENR SRAM3SMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  747. * AHB2SMENR OTGFSSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  748. * AHB2SMENR ADCSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  749. * AHB2SMENR DCMISMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  750. * AHB2SMENR AESSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  751. * AHB2SMENR HASHSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  752. * AHB2SMENR RNGSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  753. * AHB2SMENR OSPIMSMEN LL_AHB2_GRP1_EnableClockStopSleep\n
  754. * AHB2SMENR SDMMC1SMEN LL_AHB2_GRP1_EnableClockStopSleep
  755. * @param Periphs This parameter can be a combination of the following values:
  756. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOA
  757. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOB
  758. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOC
  759. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOD (*)
  760. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOE (*)
  761. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOF (*)
  762. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOG (*)
  763. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOH
  764. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOI (*)
  765. * @arg @ref LL_AHB2_GRP1_PERIPH_SRAM2
  766. * @arg @ref LL_AHB2_GRP1_PERIPH_SRAM3 (*)
  767. * @arg @ref LL_AHB2_GRP1_PERIPH_OTGFS (*)
  768. * @arg @ref LL_AHB2_GRP1_PERIPH_ADC
  769. * @arg @ref LL_AHB2_GRP1_PERIPH_DCMI (*)
  770. * @arg @ref LL_AHB2_GRP1_PERIPH_AES (*)
  771. * @arg @ref LL_AHB2_GRP1_PERIPH_HASH (*)
  772. * @arg @ref LL_AHB2_GRP1_PERIPH_RNG
  773. * @arg @ref LL_AHB2_GRP1_PERIPH_OSPIM (*)
  774. * @arg @ref LL_AHB2_GRP1_PERIPH_SDMMC1 (*)
  775. *
  776. * (*) value not defined in all devices.
  777. * @retval None
  778. */
  779. __STATIC_INLINE void LL_AHB2_GRP1_EnableClockStopSleep(uint32_t Periphs)
  780. {
  781. __IO uint32_t tmpreg;
  782. SET_BIT(RCC->AHB2SMENR, Periphs);
  783. /* Delay after an RCC peripheral clock enabling */
  784. tmpreg = READ_BIT(RCC->AHB2SMENR, Periphs);
  785. (void)tmpreg;
  786. }
  787. /**
  788. * @brief Disable AHB2 peripheral clocks in Sleep and Stop modes
  789. * @rmtoll AHB2SMENR GPIOASMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  790. * AHB2SMENR GPIOBSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  791. * AHB2SMENR GPIOCSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  792. * AHB2SMENR GPIODSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  793. * AHB2SMENR GPIOESMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  794. * AHB2SMENR GPIOFSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  795. * AHB2SMENR GPIOGSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  796. * AHB2SMENR GPIOHSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  797. * AHB2SMENR GPIOISMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  798. * AHB2SMENR SRAM2SMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  799. * AHB2SMENR SRAM3SMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  800. * AHB2SMENR OTGFSSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  801. * AHB2SMENR ADCSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  802. * AHB2SMENR DCMISMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  803. * AHB2SMENR AESSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  804. * AHB2SMENR HASHSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  805. * AHB2SMENR RNGSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  806. * AHB2SMENR OSPIMSMEN LL_AHB2_GRP1_DisableClockStopSleep\n
  807. * AHB2SMENR SDMMC1SMEN LL_AHB2_GRP1_DisableClockStopSleep
  808. * @param Periphs This parameter can be a combination of the following values:
  809. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOA
  810. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOB
  811. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOC
  812. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOD (*)
  813. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOE (*)
  814. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOF (*)
  815. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOG (*)
  816. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOH
  817. * @arg @ref LL_AHB2_GRP1_PERIPH_GPIOI (*)
  818. * @arg @ref LL_AHB2_GRP1_PERIPH_SRAM2
  819. * @arg @ref LL_AHB2_GRP1_PERIPH_SRAM3 (*)
  820. * @arg @ref LL_AHB2_GRP1_PERIPH_OTGFS (*)
  821. * @arg @ref LL_AHB2_GRP1_PERIPH_ADC
  822. * @arg @ref LL_AHB2_GRP1_PERIPH_DCMI (*)
  823. * @arg @ref LL_AHB2_GRP1_PERIPH_AES (*)
  824. * @arg @ref LL_AHB2_GRP1_PERIPH_HASH (*)
  825. * @arg @ref LL_AHB2_GRP1_PERIPH_RNG
  826. * @arg @ref LL_AHB2_GRP1_PERIPH_OSPIM (*)
  827. * @arg @ref LL_AHB2_GRP1_PERIPH_SDMMC1 (*)
  828. *
  829. * (*) value not defined in all devices.
  830. * @retval None
  831. */
  832. __STATIC_INLINE void LL_AHB2_GRP1_DisableClockStopSleep(uint32_t Periphs)
  833. {
  834. CLEAR_BIT(RCC->AHB2SMENR, Periphs);
  835. }
  836. /**
  837. * @}
  838. */
  839. /** @defgroup BUS_LL_EF_AHB3 AHB3
  840. * @{
  841. */
  842. /**
  843. * @brief Enable AHB3 peripherals clock.
  844. * @rmtoll AHB3ENR FMCEN LL_AHB3_GRP1_EnableClock\n
  845. * AHB3ENR QSPIEN LL_AHB3_GRP1_EnableClock\n
  846. * AHB3ENR OSPI1EN LL_AHB3_GRP1_EnableClock\n
  847. * AHB3ENR OSPI2EN LL_AHB3_GRP1_EnableClock
  848. * @param Periphs This parameter can be a combination of the following values:
  849. * @arg @ref LL_AHB3_GRP1_PERIPH_FMC (*)
  850. * @arg @ref LL_AHB3_GRP1_PERIPH_QSPI (*)
  851. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI1 (*)
  852. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI2 (*)
  853. *
  854. * (*) value not defined in all devices.
  855. * @retval None
  856. */
  857. __STATIC_INLINE void LL_AHB3_GRP1_EnableClock(uint32_t Periphs)
  858. {
  859. __IO uint32_t tmpreg;
  860. SET_BIT(RCC->AHB3ENR, Periphs);
  861. /* Delay after an RCC peripheral clock enabling */
  862. tmpreg = READ_BIT(RCC->AHB3ENR, Periphs);
  863. (void)tmpreg;
  864. }
  865. /**
  866. * @brief Check if AHB3 peripheral clock is enabled or not
  867. * @rmtoll AHB3ENR FMCEN LL_AHB3_GRP1_IsEnabledClock\n
  868. * AHB3ENR QSPIEN LL_AHB3_GRP1_IsEnabledClock\n
  869. * AHB3ENR OSPI1EN LL_AHB3_GRP1_IsEnabledClock\n
  870. * AHB3ENR OSPI2EN LL_AHB3_GRP1_IsEnabledClock
  871. * @param Periphs This parameter can be a combination of the following values:
  872. * @arg @ref LL_AHB3_GRP1_PERIPH_FMC (*)
  873. * @arg @ref LL_AHB3_GRP1_PERIPH_QSPI (*)
  874. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI1 (*)
  875. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI2 (*)
  876. *
  877. * (*) value not defined in all devices.
  878. * @retval State of Periphs (1 or 0).
  879. */
  880. __STATIC_INLINE uint32_t LL_AHB3_GRP1_IsEnabledClock(uint32_t Periphs)
  881. {
  882. return (READ_BIT(RCC->AHB3ENR, Periphs) == Periphs);
  883. }
  884. /**
  885. * @brief Disable AHB3 peripherals clock.
  886. * @rmtoll AHB3ENR FMCEN LL_AHB3_GRP1_DisableClock\n
  887. * AHB3ENR QSPIEN LL_AHB3_GRP1_DisableClock\n
  888. * AHB3ENR OSPI1EN LL_AHB3_GRP1_DisableClock\n
  889. * AHB3ENR OSPI2EN LL_AHB3_GRP1_DisableClock
  890. * @param Periphs This parameter can be a combination of the following values:
  891. * @arg @ref LL_AHB3_GRP1_PERIPH_FMC (*)
  892. * @arg @ref LL_AHB3_GRP1_PERIPH_QSPI (*)
  893. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI1 (*)
  894. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI2 (*)
  895. *
  896. * (*) value not defined in all devices.
  897. * @retval None
  898. */
  899. __STATIC_INLINE void LL_AHB3_GRP1_DisableClock(uint32_t Periphs)
  900. {
  901. CLEAR_BIT(RCC->AHB3ENR, Periphs);
  902. }
  903. /**
  904. * @brief Force AHB3 peripherals reset.
  905. * @rmtoll AHB3RSTR FMCRST LL_AHB3_GRP1_ForceReset\n
  906. * AHB3RSTR QSPIRST LL_AHB3_GRP1_ForceReset\n
  907. * AHB3RSTR OSPI1RST LL_AHB3_GRP1_ForceReset\n
  908. * AHB3RSTR OSPI2RST LL_AHB3_GRP1_ForceReset
  909. * @param Periphs This parameter can be a combination of the following values:
  910. * @arg @ref LL_AHB3_GRP1_PERIPH_ALL
  911. * @arg @ref LL_AHB3_GRP1_PERIPH_FMC (*)
  912. * @arg @ref LL_AHB3_GRP1_PERIPH_QSPI (*)
  913. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI1 (*)
  914. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI2 (*)
  915. *
  916. * (*) value not defined in all devices.
  917. * @retval None
  918. */
  919. __STATIC_INLINE void LL_AHB3_GRP1_ForceReset(uint32_t Periphs)
  920. {
  921. SET_BIT(RCC->AHB3RSTR, Periphs);
  922. }
  923. /**
  924. * @brief Release AHB3 peripherals reset.
  925. * @rmtoll AHB3RSTR FMCRST LL_AHB3_GRP1_ReleaseReset\n
  926. * AHB3RSTR QSPIRST LL_AHB3_GRP1_ReleaseReset\n
  927. * AHB3RSTR OSPI1RST LL_AHB3_GRP1_ReleaseReset\n
  928. * AHB3RSTR OSPI2RST LL_AHB3_GRP1_ReleaseReset
  929. * @param Periphs This parameter can be a combination of the following values:
  930. * @arg @ref LL_AHB2_GRP1_PERIPH_ALL
  931. * @arg @ref LL_AHB3_GRP1_PERIPH_FMC (*)
  932. * @arg @ref LL_AHB3_GRP1_PERIPH_QSPI (*)
  933. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI1 (*)
  934. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI2 (*)
  935. *
  936. * (*) value not defined in all devices.
  937. * @retval None
  938. */
  939. __STATIC_INLINE void LL_AHB3_GRP1_ReleaseReset(uint32_t Periphs)
  940. {
  941. CLEAR_BIT(RCC->AHB3RSTR, Periphs);
  942. }
  943. /**
  944. * @brief Enable AHB3 peripheral clocks in Sleep and Stop modes
  945. * @rmtoll AHB3SMENR FMCSMEN LL_AHB3_GRP1_EnableClockStopSleep\n
  946. * AHB3SMENR QSPISMEN LL_AHB3_GRP1_EnableClockStopSleep\n
  947. * AHB3SMENR OSPI1SMEN LL_AHB3_GRP1_EnableClockStopSleep\n
  948. * AHB3SMENR OSPI2SMEN LL_AHB3_GRP1_EnableClockStopSleep
  949. * @param Periphs This parameter can be a combination of the following values:
  950. * @arg @ref LL_AHB3_GRP1_PERIPH_FMC (*)
  951. * @arg @ref LL_AHB3_GRP1_PERIPH_QSPI (*)
  952. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI1 (*)
  953. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI2 (*)
  954. *
  955. * (*) value not defined in all devices.
  956. * @retval None
  957. */
  958. __STATIC_INLINE void LL_AHB3_GRP1_EnableClockStopSleep(uint32_t Periphs)
  959. {
  960. __IO uint32_t tmpreg;
  961. SET_BIT(RCC->AHB3SMENR, Periphs);
  962. /* Delay after an RCC peripheral clock enabling */
  963. tmpreg = READ_BIT(RCC->AHB3SMENR, Periphs);
  964. (void)tmpreg;
  965. }
  966. /**
  967. * @brief Disable AHB3 peripheral clocks in Sleep and Stop modes
  968. * @rmtoll AHB3SMENR FMCSMEN LL_AHB3_GRP1_DisableClockStopSleep\n
  969. * AHB3SMENR QSPISMEN LL_AHB3_GRP1_DisableClockStopSleep\n
  970. * AHB3SMENR OSPI1SMEN LL_AHB3_GRP1_DisableClockStopSleep\n
  971. * AHB3SMENR OSPI2SMEN LL_AHB3_GRP1_DisableClockStopSleep\n
  972. * @param Periphs This parameter can be a combination of the following values:
  973. * @arg @ref LL_AHB3_GRP1_PERIPH_FMC (*)
  974. * @arg @ref LL_AHB3_GRP1_PERIPH_QSPI (*)
  975. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI1 (*)
  976. * @arg @ref LL_AHB3_GRP1_PERIPH_OSPI2 (*)
  977. *
  978. * (*) value not defined in all devices.
  979. * @retval None
  980. */
  981. __STATIC_INLINE void LL_AHB3_GRP1_DisableClockStopSleep(uint32_t Periphs)
  982. {
  983. CLEAR_BIT(RCC->AHB3SMENR, Periphs);
  984. }
  985. /**
  986. * @}
  987. */
  988. /** @defgroup BUS_LL_EF_APB1 APB1
  989. * @{
  990. */
  991. /**
  992. * @brief Enable APB1 peripherals clock.
  993. * @rmtoll APB1ENR1 TIM2EN LL_APB1_GRP1_EnableClock\n
  994. * APB1ENR1 TIM3EN LL_APB1_GRP1_EnableClock\n
  995. * APB1ENR1 TIM4EN LL_APB1_GRP1_EnableClock\n
  996. * APB1ENR1 TIM5EN LL_APB1_GRP1_EnableClock\n
  997. * APB1ENR1 TIM6EN LL_APB1_GRP1_EnableClock\n
  998. * APB1ENR1 TIM7EN LL_APB1_GRP1_EnableClock\n
  999. * APB1ENR1 LCDEN LL_APB1_GRP1_EnableClock\n
  1000. * APB1ENR1 RTCAPBEN LL_APB1_GRP1_EnableClock\n
  1001. * APB1ENR1 WWDGEN LL_APB1_GRP1_EnableClock\n
  1002. * APB1ENR1 SPI2EN LL_APB1_GRP1_EnableClock\n
  1003. * APB1ENR1 SPI3EN LL_APB1_GRP1_EnableClock\n
  1004. * APB1ENR1 USART2EN LL_APB1_GRP1_EnableClock\n
  1005. * APB1ENR1 USART3EN LL_APB1_GRP1_EnableClock\n
  1006. * APB1ENR1 UART4EN LL_APB1_GRP1_EnableClock\n
  1007. * APB1ENR1 UART5EN LL_APB1_GRP1_EnableClock\n
  1008. * APB1ENR1 I2C1EN LL_APB1_GRP1_EnableClock\n
  1009. * APB1ENR1 I2C2EN LL_APB1_GRP1_EnableClock\n
  1010. * APB1ENR1 I2C3EN LL_APB1_GRP1_EnableClock\n
  1011. * APB1ENR1 CRSEN LL_APB1_GRP1_EnableClock\n
  1012. * APB1ENR1 CAN1EN LL_APB1_GRP1_EnableClock\n
  1013. * APB1ENR1 USBFSEN LL_APB1_GRP1_EnableClock\n
  1014. * APB1ENR1 CAN2EN LL_APB1_GRP1_EnableClock\n
  1015. * APB1ENR1 PWREN LL_APB1_GRP1_EnableClock\n
  1016. * APB1ENR1 DAC1EN LL_APB1_GRP1_EnableClock\n
  1017. * APB1ENR1 OPAMPEN LL_APB1_GRP1_EnableClock\n
  1018. * APB1ENR1 LPTIM1EN LL_APB1_GRP1_EnableClock
  1019. * @param Periphs This parameter can be a combination of the following values:
  1020. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  1021. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  1022. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)
  1023. * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)
  1024. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6
  1025. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7
  1026. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  1027. * @arg @ref LL_APB1_GRP1_PERIPH_RTCAPB (*)
  1028. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  1029. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  1030. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3
  1031. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  1032. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  1033. * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)
  1034. * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)
  1035. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  1036. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  1037. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3
  1038. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  1039. * @arg @ref LL_APB1_GRP1_PERIPH_CAN1
  1040. * @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)
  1041. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  1042. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  1043. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1
  1044. * @arg @ref LL_APB1_GRP1_PERIPH_OPAMP
  1045. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  1046. *
  1047. * (*) value not defined in all devices.
  1048. * @retval None
  1049. */
  1050. __STATIC_INLINE void LL_APB1_GRP1_EnableClock(uint32_t Periphs)
  1051. {
  1052. __IO uint32_t tmpreg;
  1053. SET_BIT(RCC->APB1ENR1, Periphs);
  1054. /* Delay after an RCC peripheral clock enabling */
  1055. tmpreg = READ_BIT(RCC->APB1ENR1, Periphs);
  1056. (void)tmpreg;
  1057. }
  1058. /**
  1059. * @brief Enable APB1 peripherals clock.
  1060. * @rmtoll APB1ENR2 LPUART1EN LL_APB1_GRP2_EnableClock\n
  1061. * APB1ENR2 I2C4EN LL_APB1_GRP2_EnableClock\n
  1062. * APB1ENR2 SWPMI1EN LL_APB1_GRP2_EnableClock\n
  1063. * APB1ENR2 LPTIM2EN LL_APB1_GRP2_EnableClock
  1064. * @param Periphs This parameter can be a combination of the following values:
  1065. * @arg @ref LL_APB1_GRP2_PERIPH_LPUART1
  1066. * @arg @ref LL_APB1_GRP2_PERIPH_I2C4 (*)
  1067. * @arg @ref LL_APB1_GRP2_PERIPH_SWPMI1 (*)
  1068. * @arg @ref LL_APB1_GRP2_PERIPH_LPTIM2
  1069. *
  1070. * (*) value not defined in all devices.
  1071. * @retval None
  1072. */
  1073. __STATIC_INLINE void LL_APB1_GRP2_EnableClock(uint32_t Periphs)
  1074. {
  1075. __IO uint32_t tmpreg;
  1076. SET_BIT(RCC->APB1ENR2, Periphs);
  1077. /* Delay after an RCC peripheral clock enabling */
  1078. tmpreg = READ_BIT(RCC->APB1ENR2, Periphs);
  1079. (void)tmpreg;
  1080. }
  1081. /**
  1082. * @brief Check if APB1 peripheral clock is enabled or not
  1083. * @rmtoll APB1ENR1 TIM2EN LL_APB1_GRP1_IsEnabledClock\n
  1084. * APB1ENR1 TIM3EN LL_APB1_GRP1_IsEnabledClock\n
  1085. * APB1ENR1 TIM4EN LL_APB1_GRP1_IsEnabledClock\n
  1086. * APB1ENR1 TIM5EN LL_APB1_GRP1_IsEnabledClock\n
  1087. * APB1ENR1 TIM6EN LL_APB1_GRP1_IsEnabledClock\n
  1088. * APB1ENR1 TIM7EN LL_APB1_GRP1_IsEnabledClock\n
  1089. * APB1ENR1 LCDEN LL_APB1_GRP1_IsEnabledClock\n
  1090. * APB1ENR1 RTCAPBEN LL_APB1_GRP1_IsEnabledClock\n
  1091. * APB1ENR1 WWDGEN LL_APB1_GRP1_IsEnabledClock\n
  1092. * APB1ENR1 SPI2EN LL_APB1_GRP1_IsEnabledClock\n
  1093. * APB1ENR1 SPI3EN LL_APB1_GRP1_IsEnabledClock\n
  1094. * APB1ENR1 USART2EN LL_APB1_GRP1_IsEnabledClock\n
  1095. * APB1ENR1 USART3EN LL_APB1_GRP1_IsEnabledClock\n
  1096. * APB1ENR1 UART4EN LL_APB1_GRP1_IsEnabledClock\n
  1097. * APB1ENR1 UART5EN LL_APB1_GRP1_IsEnabledClock\n
  1098. * APB1ENR1 I2C1EN LL_APB1_GRP1_IsEnabledClock\n
  1099. * APB1ENR1 I2C2EN LL_APB1_GRP1_IsEnabledClock\n
  1100. * APB1ENR1 I2C3EN LL_APB1_GRP1_IsEnabledClock\n
  1101. * APB1ENR1 CRSEN LL_APB1_GRP1_IsEnabledClock\n
  1102. * APB1ENR1 CAN1EN LL_APB1_GRP1_IsEnabledClock\n
  1103. * APB1ENR1 USBFSEN LL_APB1_GRP1_IsEnabledClock\n
  1104. * APB1ENR1 CAN2EN LL_APB1_GRP1_IsEnabledClock\n
  1105. * APB1ENR1 PWREN LL_APB1_GRP1_IsEnabledClock\n
  1106. * APB1ENR1 DAC1EN LL_APB1_GRP1_IsEnabledClock\n
  1107. * APB1ENR1 OPAMPEN LL_APB1_GRP1_IsEnabledClock\n
  1108. * APB1ENR1 LPTIM1EN LL_APB1_GRP1_IsEnabledClock
  1109. * @param Periphs This parameter can be a combination of the following values:
  1110. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  1111. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  1112. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)
  1113. * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)
  1114. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6
  1115. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7
  1116. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  1117. * @arg @ref LL_APB1_GRP1_PERIPH_RTCAPB (*)
  1118. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  1119. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  1120. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3
  1121. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  1122. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  1123. * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)
  1124. * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)
  1125. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  1126. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  1127. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3
  1128. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  1129. * @arg @ref LL_APB1_GRP1_PERIPH_CAN1
  1130. * @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)
  1131. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  1132. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  1133. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1
  1134. * @arg @ref LL_APB1_GRP1_PERIPH_OPAMP
  1135. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  1136. *
  1137. * (*) value not defined in all devices.
  1138. * @retval State of Periphs (1 or 0).
  1139. */
  1140. __STATIC_INLINE uint32_t LL_APB1_GRP1_IsEnabledClock(uint32_t Periphs)
  1141. {
  1142. return (READ_BIT(RCC->APB1ENR1, Periphs) == Periphs);
  1143. }
  1144. /**
  1145. * @brief Check if APB1 peripheral clock is enabled or not
  1146. * @rmtoll APB1ENR2 LPUART1EN LL_APB1_GRP2_IsEnabledClock\n
  1147. * APB1ENR2 I2C4EN LL_APB1_GRP2_IsEnabledClock\n
  1148. * APB1ENR2 SWPMI1EN LL_APB1_GRP2_IsEnabledClock\n
  1149. * APB1ENR2 LPTIM2EN LL_APB1_GRP2_IsEnabledClock
  1150. * @param Periphs This parameter can be a combination of the following values:
  1151. * @arg @ref LL_APB1_GRP2_PERIPH_LPUART1
  1152. * @arg @ref LL_APB1_GRP2_PERIPH_I2C4 (*)
  1153. * @arg @ref LL_APB1_GRP2_PERIPH_SWPMI1 (*)
  1154. * @arg @ref LL_APB1_GRP2_PERIPH_LPTIM2
  1155. *
  1156. * (*) value not defined in all devices.
  1157. * @retval State of Periphs (1 or 0).
  1158. */
  1159. __STATIC_INLINE uint32_t LL_APB1_GRP2_IsEnabledClock(uint32_t Periphs)
  1160. {
  1161. return (READ_BIT(RCC->APB1ENR2, Periphs) == Periphs);
  1162. }
  1163. /**
  1164. * @brief Disable APB1 peripherals clock.
  1165. * @rmtoll APB1ENR1 TIM2EN LL_APB1_GRP1_DisableClock\n
  1166. * APB1ENR1 TIM3EN LL_APB1_GRP1_DisableClock\n
  1167. * APB1ENR1 TIM4EN LL_APB1_GRP1_DisableClock\n
  1168. * APB1ENR1 TIM5EN LL_APB1_GRP1_DisableClock\n
  1169. * APB1ENR1 TIM6EN LL_APB1_GRP1_DisableClock\n
  1170. * APB1ENR1 TIM7EN LL_APB1_GRP1_DisableClock\n
  1171. * APB1ENR1 LCDEN LL_APB1_GRP1_DisableClock\n
  1172. * APB1ENR1 RTCAPBEN LL_APB1_GRP1_DisableClock\n
  1173. * APB1ENR1 WWDGEN LL_APB1_GRP1_DisableClock\n
  1174. * APB1ENR1 SPI2EN LL_APB1_GRP1_DisableClock\n
  1175. * APB1ENR1 SPI3EN LL_APB1_GRP1_DisableClock\n
  1176. * APB1ENR1 USART2EN LL_APB1_GRP1_DisableClock\n
  1177. * APB1ENR1 USART3EN LL_APB1_GRP1_DisableClock\n
  1178. * APB1ENR1 UART4EN LL_APB1_GRP1_DisableClock\n
  1179. * APB1ENR1 UART5EN LL_APB1_GRP1_DisableClock\n
  1180. * APB1ENR1 I2C1EN LL_APB1_GRP1_DisableClock\n
  1181. * APB1ENR1 I2C2EN LL_APB1_GRP1_DisableClock\n
  1182. * APB1ENR1 I2C3EN LL_APB1_GRP1_DisableClock\n
  1183. * APB1ENR1 CRSEN LL_APB1_GRP1_DisableClock\n
  1184. * APB1ENR1 CAN1EN LL_APB1_GRP1_DisableClock\n
  1185. * APB1ENR1 USBFSEN LL_APB1_GRP1_DisableClock\n
  1186. * APB1ENR1 CAN2EN LL_APB1_GRP1_DisableClock\n
  1187. * APB1ENR1 PWREN LL_APB1_GRP1_DisableClock\n
  1188. * APB1ENR1 DAC1EN LL_APB1_GRP1_DisableClock\n
  1189. * APB1ENR1 OPAMPEN LL_APB1_GRP1_DisableClock\n
  1190. * APB1ENR1 LPTIM1EN LL_APB1_GRP1_DisableClock
  1191. * @param Periphs This parameter can be a combination of the following values:
  1192. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  1193. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  1194. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)
  1195. * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)
  1196. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6
  1197. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7
  1198. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  1199. * @arg @ref LL_APB1_GRP1_PERIPH_RTCAPB (*)
  1200. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  1201. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  1202. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3
  1203. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  1204. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  1205. * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)
  1206. * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)
  1207. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  1208. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  1209. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3
  1210. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  1211. * @arg @ref LL_APB1_GRP1_PERIPH_CAN1
  1212. * @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)
  1213. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  1214. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  1215. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1
  1216. * @arg @ref LL_APB1_GRP1_PERIPH_OPAMP
  1217. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  1218. *
  1219. * (*) value not defined in all devices.
  1220. * @retval None
  1221. */
  1222. __STATIC_INLINE void LL_APB1_GRP1_DisableClock(uint32_t Periphs)
  1223. {
  1224. CLEAR_BIT(RCC->APB1ENR1, Periphs);
  1225. }
  1226. /**
  1227. * @brief Disable APB1 peripherals clock.
  1228. * @rmtoll APB1ENR2 LPUART1EN LL_APB1_GRP2_DisableClock\n
  1229. * APB1ENR2 I2C4EN LL_APB1_GRP2_DisableClock\n
  1230. * APB1ENR2 SWPMI1EN LL_APB1_GRP2_DisableClock\n
  1231. * APB1ENR2 LPTIM2EN LL_APB1_GRP2_DisableClock
  1232. * @param Periphs This parameter can be a combination of the following values:
  1233. * @arg @ref LL_APB1_GRP2_PERIPH_LPUART1
  1234. * @arg @ref LL_APB1_GRP2_PERIPH_I2C4 (*)
  1235. * @arg @ref LL_APB1_GRP2_PERIPH_SWPMI1 (*)
  1236. * @arg @ref LL_APB1_GRP2_PERIPH_LPTIM2
  1237. *
  1238. * (*) value not defined in all devices.
  1239. * @retval None
  1240. */
  1241. __STATIC_INLINE void LL_APB1_GRP2_DisableClock(uint32_t Periphs)
  1242. {
  1243. CLEAR_BIT(RCC->APB1ENR2, Periphs);
  1244. }
  1245. /**
  1246. * @brief Force APB1 peripherals reset.
  1247. * @rmtoll APB1RSTR1 TIM2RST LL_APB1_GRP1_ForceReset\n
  1248. * APB1RSTR1 TIM3RST LL_APB1_GRP1_ForceReset\n
  1249. * APB1RSTR1 TIM4RST LL_APB1_GRP1_ForceReset\n
  1250. * APB1RSTR1 TIM5RST LL_APB1_GRP1_ForceReset\n
  1251. * APB1RSTR1 TIM6RST LL_APB1_GRP1_ForceReset\n
  1252. * APB1RSTR1 TIM7RST LL_APB1_GRP1_ForceReset\n
  1253. * APB1RSTR1 LCDRST LL_APB1_GRP1_ForceReset\n
  1254. * APB1RSTR1 SPI2RST LL_APB1_GRP1_ForceReset\n
  1255. * APB1RSTR1 SPI3RST LL_APB1_GRP1_ForceReset\n
  1256. * APB1RSTR1 USART2RST LL_APB1_GRP1_ForceReset\n
  1257. * APB1RSTR1 USART3RST LL_APB1_GRP1_ForceReset\n
  1258. * APB1RSTR1 UART4RST LL_APB1_GRP1_ForceReset\n
  1259. * APB1RSTR1 UART5RST LL_APB1_GRP1_ForceReset\n
  1260. * APB1RSTR1 I2C1RST LL_APB1_GRP1_ForceReset\n
  1261. * APB1RSTR1 I2C2RST LL_APB1_GRP1_ForceReset\n
  1262. * APB1RSTR1 I2C3RST LL_APB1_GRP1_ForceReset\n
  1263. * APB1RSTR1 CRSRST LL_APB1_GRP1_ForceReset\n
  1264. * APB1RSTR1 CAN1RST LL_APB1_GRP1_ForceReset\n
  1265. * APB1RSTR1 USBFSRST LL_APB1_GRP1_ForceReset\n
  1266. * APB1RSTR1 CAN2RST LL_APB1_GRP1_ForceReset\n
  1267. * APB1RSTR1 PWRRST LL_APB1_GRP1_ForceReset\n
  1268. * APB1RSTR1 DAC1RST LL_APB1_GRP1_ForceReset\n
  1269. * APB1RSTR1 OPAMPRST LL_APB1_GRP1_ForceReset\n
  1270. * APB1RSTR1 LPTIM1RST LL_APB1_GRP1_ForceReset
  1271. * @param Periphs This parameter can be a combination of the following values:
  1272. * @arg @ref LL_APB1_GRP1_PERIPH_ALL
  1273. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  1274. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  1275. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)
  1276. * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)
  1277. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6
  1278. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7
  1279. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  1280. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  1281. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3
  1282. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  1283. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  1284. * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)
  1285. * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)
  1286. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  1287. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  1288. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3
  1289. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  1290. * @arg @ref LL_APB1_GRP1_PERIPH_CAN1
  1291. * @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)
  1292. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  1293. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  1294. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1
  1295. * @arg @ref LL_APB1_GRP1_PERIPH_OPAMP
  1296. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  1297. *
  1298. * (*) value not defined in all devices.
  1299. * @retval None
  1300. */
  1301. __STATIC_INLINE void LL_APB1_GRP1_ForceReset(uint32_t Periphs)
  1302. {
  1303. SET_BIT(RCC->APB1RSTR1, Periphs);
  1304. }
  1305. /**
  1306. * @brief Force APB1 peripherals reset.
  1307. * @rmtoll APB1RSTR2 LPUART1RST LL_APB1_GRP2_ForceReset\n
  1308. * APB1RSTR2 I2C4RST LL_APB1_GRP2_ForceReset\n
  1309. * APB1RSTR2 SWPMI1RST LL_APB1_GRP2_ForceReset\n
  1310. * APB1RSTR2 LPTIM2RST LL_APB1_GRP2_ForceReset
  1311. * @param Periphs This parameter can be a combination of the following values:
  1312. * @arg @ref LL_APB1_GRP2_PERIPH_ALL
  1313. * @arg @ref LL_APB1_GRP2_PERIPH_LPUART1
  1314. * @arg @ref LL_APB1_GRP2_PERIPH_I2C4 (*)
  1315. * @arg @ref LL_APB1_GRP2_PERIPH_SWPMI1 (*)
  1316. * @arg @ref LL_APB1_GRP2_PERIPH_LPTIM2
  1317. *
  1318. * (*) value not defined in all devices.
  1319. * @retval None
  1320. */
  1321. __STATIC_INLINE void LL_APB1_GRP2_ForceReset(uint32_t Periphs)
  1322. {
  1323. SET_BIT(RCC->APB1RSTR2, Periphs);
  1324. }
  1325. /**
  1326. * @brief Release APB1 peripherals reset.
  1327. * @rmtoll APB1RSTR1 TIM2RST LL_APB1_GRP1_ReleaseReset\n
  1328. * APB1RSTR1 TIM3RST LL_APB1_GRP1_ReleaseReset\n
  1329. * APB1RSTR1 TIM4RST LL_APB1_GRP1_ReleaseReset\n
  1330. * APB1RSTR1 TIM5RST LL_APB1_GRP1_ReleaseReset\n
  1331. * APB1RSTR1 TIM6RST LL_APB1_GRP1_ReleaseReset\n
  1332. * APB1RSTR1 TIM7RST LL_APB1_GRP1_ReleaseReset\n
  1333. * APB1RSTR1 LCDRST LL_APB1_GRP1_ReleaseReset\n
  1334. * APB1RSTR1 SPI2RST LL_APB1_GRP1_ReleaseReset\n
  1335. * APB1RSTR1 SPI3RST LL_APB1_GRP1_ReleaseReset\n
  1336. * APB1RSTR1 USART2RST LL_APB1_GRP1_ReleaseReset\n
  1337. * APB1RSTR1 USART3RST LL_APB1_GRP1_ReleaseReset\n
  1338. * APB1RSTR1 UART4RST LL_APB1_GRP1_ReleaseReset\n
  1339. * APB1RSTR1 UART5RST LL_APB1_GRP1_ReleaseReset\n
  1340. * APB1RSTR1 I2C1RST LL_APB1_GRP1_ReleaseReset\n
  1341. * APB1RSTR1 I2C2RST LL_APB1_GRP1_ReleaseReset\n
  1342. * APB1RSTR1 I2C3RST LL_APB1_GRP1_ReleaseReset\n
  1343. * APB1RSTR1 CRSRST LL_APB1_GRP1_ReleaseReset\n
  1344. * APB1RSTR1 CAN1RST LL_APB1_GRP1_ReleaseReset\n
  1345. * APB1RSTR1 USBFSRST LL_APB1_GRP1_ReleaseReset\n
  1346. * APB1RSTR1 CAN2RST LL_APB1_GRP1_ReleaseReset\n
  1347. * APB1RSTR1 PWRRST LL_APB1_GRP1_ReleaseReset\n
  1348. * APB1RSTR1 DAC1RST LL_APB1_GRP1_ReleaseReset\n
  1349. * APB1RSTR1 OPAMPRST LL_APB1_GRP1_ReleaseReset\n
  1350. * APB1RSTR1 LPTIM1RST LL_APB1_GRP1_ReleaseReset
  1351. * @param Periphs This parameter can be a combination of the following values:
  1352. * @arg @ref LL_APB1_GRP1_PERIPH_ALL
  1353. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  1354. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  1355. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)
  1356. * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)
  1357. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6
  1358. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7
  1359. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  1360. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  1361. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3
  1362. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  1363. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  1364. * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)
  1365. * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)
  1366. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  1367. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  1368. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3
  1369. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  1370. * @arg @ref LL_APB1_GRP1_PERIPH_CAN1
  1371. * @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)
  1372. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  1373. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  1374. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1
  1375. * @arg @ref LL_APB1_GRP1_PERIPH_OPAMP
  1376. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  1377. *
  1378. * (*) value not defined in all devices.
  1379. * @retval None
  1380. */
  1381. __STATIC_INLINE void LL_APB1_GRP1_ReleaseReset(uint32_t Periphs)
  1382. {
  1383. CLEAR_BIT(RCC->APB1RSTR1, Periphs);
  1384. }
  1385. /**
  1386. * @brief Release APB1 peripherals reset.
  1387. * @rmtoll APB1RSTR2 LPUART1RST LL_APB1_GRP2_ReleaseReset\n
  1388. * APB1RSTR2 I2C4RST LL_APB1_GRP2_ReleaseReset\n
  1389. * APB1RSTR2 SWPMI1RST LL_APB1_GRP2_ReleaseReset\n
  1390. * APB1RSTR2 LPTIM2RST LL_APB1_GRP2_ReleaseReset
  1391. * @param Periphs This parameter can be a combination of the following values:
  1392. * @arg @ref LL_APB1_GRP2_PERIPH_ALL
  1393. * @arg @ref LL_APB1_GRP2_PERIPH_LPUART1
  1394. * @arg @ref LL_APB1_GRP2_PERIPH_I2C4 (*)
  1395. * @arg @ref LL_APB1_GRP2_PERIPH_SWPMI1 (*)
  1396. * @arg @ref LL_APB1_GRP2_PERIPH_LPTIM2
  1397. *
  1398. * (*) value not defined in all devices.
  1399. * @retval None
  1400. */
  1401. __STATIC_INLINE void LL_APB1_GRP2_ReleaseReset(uint32_t Periphs)
  1402. {
  1403. CLEAR_BIT(RCC->APB1RSTR2, Periphs);
  1404. }
  1405. /**
  1406. * @brief Enable APB1 peripheral clocks in Sleep and Stop modes
  1407. * @rmtoll APB1SMENR1 TIM2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1408. * APB1SMENR1 TIM3SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1409. * APB1SMENR1 TIM4SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1410. * APB1SMENR1 TIM5SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1411. * APB1SMENR1 TIM6SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1412. * APB1SMENR1 TIM7SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1413. * APB1SMENR1 LCDSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1414. * APB1SMENR1 RTCAPBSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1415. * APB1SMENR1 WWDGSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1416. * APB1SMENR1 SPI2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1417. * APB1SMENR1 SPI3SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1418. * APB1SMENR1 USART2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1419. * APB1SMENR1 USART3SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1420. * APB1SMENR1 UART4SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1421. * APB1SMENR1 UART5SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1422. * APB1SMENR1 I2C1SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1423. * APB1SMENR1 I2C2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1424. * APB1SMENR1 I2C3SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1425. * APB1SMENR1 CRSSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1426. * APB1SMENR1 CAN1SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1427. * APB1SMENR1 USBFSSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1428. * APB1SMENR1 CAN2SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1429. * APB1SMENR1 PWRSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1430. * APB1SMENR1 DAC1SMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1431. * APB1SMENR1 OPAMPSMEN LL_APB1_GRP1_EnableClockStopSleep\n
  1432. * APB1SMENR1 LPTIM1SMEN LL_APB1_GRP1_EnableClockStopSleep
  1433. * @param Periphs This parameter can be a combination of the following values:
  1434. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  1435. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  1436. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)
  1437. * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)
  1438. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6
  1439. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7
  1440. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  1441. * @arg @ref LL_APB1_GRP1_PERIPH_RTCAPB (*)
  1442. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  1443. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  1444. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3
  1445. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  1446. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  1447. * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)
  1448. * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)
  1449. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  1450. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  1451. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3
  1452. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  1453. * @arg @ref LL_APB1_GRP1_PERIPH_CAN1
  1454. * @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)
  1455. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  1456. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  1457. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1
  1458. * @arg @ref LL_APB1_GRP1_PERIPH_OPAMP
  1459. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  1460. *
  1461. * (*) value not defined in all devices.
  1462. * @retval None
  1463. */
  1464. __STATIC_INLINE void LL_APB1_GRP1_EnableClockStopSleep(uint32_t Periphs)
  1465. {
  1466. __IO uint32_t tmpreg;
  1467. SET_BIT(RCC->APB1SMENR1, Periphs);
  1468. /* Delay after an RCC peripheral clock enabling */
  1469. tmpreg = READ_BIT(RCC->APB1SMENR1, Periphs);
  1470. (void)tmpreg;
  1471. }
  1472. /**
  1473. * @brief Enable APB1 peripheral clocks in Sleep and Stop modes
  1474. * @rmtoll APB1SMENR2 LPUART1SMEN LL_APB1_GRP2_EnableClockStopSleep\n
  1475. * APB1SMENR2 I2C4SMEN LL_APB1_GRP2_EnableClockStopSleep\n
  1476. * APB1SMENR2 SWPMI1SMEN LL_APB1_GRP2_EnableClockStopSleep\n
  1477. * APB1SMENR2 LPTIM2SMEN LL_APB1_GRP2_EnableClockStopSleep
  1478. * @param Periphs This parameter can be a combination of the following values:
  1479. * @arg @ref LL_APB1_GRP2_PERIPH_LPUART1
  1480. * @arg @ref LL_APB1_GRP2_PERIPH_I2C4 (*)
  1481. * @arg @ref LL_APB1_GRP2_PERIPH_SWPMI1 (*)
  1482. * @arg @ref LL_APB1_GRP2_PERIPH_LPTIM2
  1483. *
  1484. * (*) value not defined in all devices.
  1485. * @retval None
  1486. */
  1487. __STATIC_INLINE void LL_APB1_GRP2_EnableClockStopSleep(uint32_t Periphs)
  1488. {
  1489. __IO uint32_t tmpreg;
  1490. SET_BIT(RCC->APB1SMENR2, Periphs);
  1491. /* Delay after an RCC peripheral clock enabling */
  1492. tmpreg = READ_BIT(RCC->APB1SMENR2, Periphs);
  1493. (void)tmpreg;
  1494. }
  1495. /**
  1496. * @brief Disable APB1 peripheral clocks in Sleep and Stop modes
  1497. * @rmtoll APB1SMENR1 TIM2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1498. * APB1SMENR1 TIM3SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1499. * APB1SMENR1 TIM4SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1500. * APB1SMENR1 TIM5SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1501. * APB1SMENR1 TIM6SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1502. * APB1SMENR1 TIM7SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1503. * APB1SMENR1 LCDSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1504. * APB1SMENR1 RTCAPBSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1505. * APB1SMENR1 WWDGSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1506. * APB1SMENR1 SPI2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1507. * APB1SMENR1 SPI3SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1508. * APB1SMENR1 USART2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1509. * APB1SMENR1 USART3SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1510. * APB1SMENR1 UART4SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1511. * APB1SMENR1 UART5SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1512. * APB1SMENR1 I2C1SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1513. * APB1SMENR1 I2C2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1514. * APB1SMENR1 I2C3SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1515. * APB1SMENR1 CRSSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1516. * APB1SMENR1 CAN1SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1517. * APB1SMENR1 USBFSSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1518. * APB1SMENR1 CAN2SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1519. * APB1SMENR1 PWRSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1520. * APB1SMENR1 DAC1SMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1521. * APB1SMENR1 OPAMPSMEN LL_APB1_GRP1_DisableClockStopSleep\n
  1522. * APB1SMENR1 LPTIM1SMEN LL_APB1_GRP1_DisableClockStopSleep
  1523. * @param Periphs This parameter can be a combination of the following values:
  1524. * @arg @ref LL_APB1_GRP1_PERIPH_TIM2
  1525. * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*)
  1526. * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)
  1527. * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)
  1528. * @arg @ref LL_APB1_GRP1_PERIPH_TIM6
  1529. * @arg @ref LL_APB1_GRP1_PERIPH_TIM7
  1530. * @arg @ref LL_APB1_GRP1_PERIPH_LCD (*)
  1531. * @arg @ref LL_APB1_GRP1_PERIPH_RTCAPB (*)
  1532. * @arg @ref LL_APB1_GRP1_PERIPH_WWDG
  1533. * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)
  1534. * @arg @ref LL_APB1_GRP1_PERIPH_SPI3
  1535. * @arg @ref LL_APB1_GRP1_PERIPH_USART2
  1536. * @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)
  1537. * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)
  1538. * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)
  1539. * @arg @ref LL_APB1_GRP1_PERIPH_I2C1
  1540. * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)
  1541. * @arg @ref LL_APB1_GRP1_PERIPH_I2C3
  1542. * @arg @ref LL_APB1_GRP1_PERIPH_CRS (*)
  1543. * @arg @ref LL_APB1_GRP1_PERIPH_CAN1
  1544. * @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)
  1545. * @arg @ref LL_APB1_GRP1_PERIPH_USB (*)
  1546. * @arg @ref LL_APB1_GRP1_PERIPH_PWR
  1547. * @arg @ref LL_APB1_GRP1_PERIPH_DAC1
  1548. * @arg @ref LL_APB1_GRP1_PERIPH_OPAMP
  1549. * @arg @ref LL_APB1_GRP1_PERIPH_LPTIM1
  1550. *
  1551. * (*) value not defined in all devices.
  1552. * @retval None
  1553. */
  1554. __STATIC_INLINE void LL_APB1_GRP1_DisableClockStopSleep(uint32_t Periphs)
  1555. {
  1556. CLEAR_BIT(RCC->APB1SMENR1, Periphs);
  1557. }
  1558. /**
  1559. * @brief Disable APB1 peripheral clocks in Sleep and Stop modes
  1560. * @rmtoll APB1SMENR2 LPUART1SMEN LL_APB1_GRP2_DisableClockStopSleep\n
  1561. * APB1SMENR2 I2C4SMEN LL_APB1_GRP2_DisableClockStopSleep\n
  1562. * APB1SMENR2 SWPMI1SMEN LL_APB1_GRP2_DisableClockStopSleep\n
  1563. * APB1SMENR2 LPTIM2SMEN LL_APB1_GRP2_DisableClockStopSleep
  1564. * @param Periphs This parameter can be a combination of the following values:
  1565. * @arg @ref LL_APB1_GRP2_PERIPH_LPUART1
  1566. * @arg @ref LL_APB1_GRP2_PERIPH_I2C4 (*)
  1567. * @arg @ref LL_APB1_GRP2_PERIPH_SWPMI1 (*)
  1568. * @arg @ref LL_APB1_GRP2_PERIPH_LPTIM2
  1569. *
  1570. * (*) value not defined in all devices.
  1571. * @retval None
  1572. */
  1573. __STATIC_INLINE void LL_APB1_GRP2_DisableClockStopSleep(uint32_t Periphs)
  1574. {
  1575. CLEAR_BIT(RCC->APB1SMENR2, Periphs);
  1576. }
  1577. /**
  1578. * @}
  1579. */
  1580. /** @defgroup BUS_LL_EF_APB2 APB2
  1581. * @{
  1582. */
  1583. /**
  1584. * @brief Enable APB2 peripherals clock.
  1585. * @rmtoll APB2ENR SYSCFGEN LL_APB2_GRP1_EnableClock\n
  1586. * APB2ENR FWEN LL_APB2_GRP1_EnableClock\n
  1587. * APB2ENR SDMMC1EN LL_APB2_GRP1_EnableClock\n
  1588. * APB2ENR TIM1EN LL_APB2_GRP1_EnableClock\n
  1589. * APB2ENR SPI1EN LL_APB2_GRP1_EnableClock\n
  1590. * APB2ENR TIM8EN LL_APB2_GRP1_EnableClock\n
  1591. * APB2ENR USART1EN LL_APB2_GRP1_EnableClock\n
  1592. * APB2ENR TIM15EN LL_APB2_GRP1_EnableClock\n
  1593. * APB2ENR TIM16EN LL_APB2_GRP1_EnableClock\n
  1594. * APB2ENR TIM17EN LL_APB2_GRP1_EnableClock\n
  1595. * APB2ENR SAI1EN LL_APB2_GRP1_EnableClock\n
  1596. * APB2ENR SAI2EN LL_APB2_GRP1_EnableClock\n
  1597. * APB2ENR DFSDM1EN LL_APB2_GRP1_EnableClock\n
  1598. * APB2ENR LTDCEN LL_APB2_GRP1_EnableClock\n
  1599. * APB2ENR DSIEN LL_APB2_GRP1_EnableClock
  1600. * @param Periphs This parameter can be a combination of the following values:
  1601. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  1602. * @arg @ref LL_APB2_GRP1_PERIPH_FW
  1603. * @arg @ref LL_APB2_GRP1_PERIPH_SDMMC1 (*)
  1604. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  1605. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  1606. * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)
  1607. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  1608. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15
  1609. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  1610. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)
  1611. * @arg @ref LL_APB2_GRP1_PERIPH_SAI1
  1612. * @arg @ref LL_APB2_GRP1_PERIPH_SAI2 (*)
  1613. * @arg @ref LL_APB2_GRP1_PERIPH_DFSDM1 (*)
  1614. * @arg @ref LL_APB2_GRP1_PERIPH_LTDC (*)
  1615. * @arg @ref LL_APB2_GRP1_PERIPH_DSI (*)
  1616. *
  1617. * (*) value not defined in all devices.
  1618. * @retval None
  1619. */
  1620. __STATIC_INLINE void LL_APB2_GRP1_EnableClock(uint32_t Periphs)
  1621. {
  1622. __IO uint32_t tmpreg;
  1623. SET_BIT(RCC->APB2ENR, Periphs);
  1624. /* Delay after an RCC peripheral clock enabling */
  1625. tmpreg = READ_BIT(RCC->APB2ENR, Periphs);
  1626. (void)tmpreg;
  1627. }
  1628. /**
  1629. * @brief Check if APB2 peripheral clock is enabled or not
  1630. * @rmtoll APB2ENR SYSCFGEN LL_APB2_GRP1_IsEnabledClock\n
  1631. * APB2ENR FWEN LL_APB2_GRP1_IsEnabledClock\n
  1632. * APB2ENR SDMMC1EN LL_APB2_GRP1_IsEnabledClock\n
  1633. * APB2ENR TIM1EN LL_APB2_GRP1_IsEnabledClock\n
  1634. * APB2ENR SPI1EN LL_APB2_GRP1_IsEnabledClock\n
  1635. * APB2ENR TIM8EN LL_APB2_GRP1_IsEnabledClock\n
  1636. * APB2ENR USART1EN LL_APB2_GRP1_IsEnabledClock\n
  1637. * APB2ENR TIM15EN LL_APB2_GRP1_IsEnabledClock\n
  1638. * APB2ENR TIM16EN LL_APB2_GRP1_IsEnabledClock\n
  1639. * APB2ENR TIM17EN LL_APB2_GRP1_IsEnabledClock\n
  1640. * APB2ENR SAI1EN LL_APB2_GRP1_IsEnabledClock\n
  1641. * APB2ENR SAI2EN LL_APB2_GRP1_IsEnabledClock\n
  1642. * APB2ENR DFSDM1EN LL_APB2_GRP1_IsEnabledClock\n
  1643. * APB2ENR LTDCEN LL_APB2_GRP1_IsEnabledClock\n
  1644. * APB2ENR DSIEN LL_APB2_GRP1_IsEnabledClock
  1645. * @param Periphs This parameter can be a combination of the following values:
  1646. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  1647. * @arg @ref LL_APB2_GRP1_PERIPH_FW
  1648. * @arg @ref LL_APB2_GRP1_PERIPH_SDMMC1 (*)
  1649. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  1650. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  1651. * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)
  1652. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  1653. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15
  1654. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  1655. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)
  1656. * @arg @ref LL_APB2_GRP1_PERIPH_SAI1
  1657. * @arg @ref LL_APB2_GRP1_PERIPH_SAI2 (*)
  1658. * @arg @ref LL_APB2_GRP1_PERIPH_DFSDM1 (*)
  1659. * @arg @ref LL_APB2_GRP1_PERIPH_LTDC (*)
  1660. * @arg @ref LL_APB2_GRP1_PERIPH_DSI (*)
  1661. *
  1662. * (*) value not defined in all devices.
  1663. * @retval State of Periphs (1 or 0).
  1664. */
  1665. __STATIC_INLINE uint32_t LL_APB2_GRP1_IsEnabledClock(uint32_t Periphs)
  1666. {
  1667. return (READ_BIT(RCC->APB2ENR, Periphs) == Periphs);
  1668. }
  1669. /**
  1670. * @brief Disable APB2 peripherals clock.
  1671. * @rmtoll APB2ENR SYSCFGEN LL_APB2_GRP1_DisableClock\n
  1672. * APB2ENR SDMMC1EN LL_APB2_GRP1_DisableClock\n
  1673. * APB2ENR TIM1EN LL_APB2_GRP1_DisableClock\n
  1674. * APB2ENR SPI1EN LL_APB2_GRP1_DisableClock\n
  1675. * APB2ENR TIM8EN LL_APB2_GRP1_DisableClock\n
  1676. * APB2ENR USART1EN LL_APB2_GRP1_DisableClock\n
  1677. * APB2ENR TIM15EN LL_APB2_GRP1_DisableClock\n
  1678. * APB2ENR TIM16EN LL_APB2_GRP1_DisableClock\n
  1679. * APB2ENR TIM17EN LL_APB2_GRP1_DisableClock\n
  1680. * APB2ENR SAI1EN LL_APB2_GRP1_DisableClock\n
  1681. * APB2ENR SAI2EN LL_APB2_GRP1_DisableClock\n
  1682. * APB2ENR DFSDM1EN LL_APB2_GRP1_DisableClock\n
  1683. * APB2ENR LTDCEN LL_APB2_GRP1_DisableClock\n
  1684. * APB2ENR DSIEN LL_APB2_GRP1_DisableClock
  1685. * @param Periphs This parameter can be a combination of the following values:
  1686. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  1687. * @arg @ref LL_APB2_GRP1_PERIPH_SDMMC1 (*)
  1688. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  1689. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  1690. * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)
  1691. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  1692. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15
  1693. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  1694. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)
  1695. * @arg @ref LL_APB2_GRP1_PERIPH_SAI1
  1696. * @arg @ref LL_APB2_GRP1_PERIPH_SAI2 (*)
  1697. * @arg @ref LL_APB2_GRP1_PERIPH_DFSDM1 (*)
  1698. * @arg @ref LL_APB2_GRP1_PERIPH_LTDC (*)
  1699. * @arg @ref LL_APB2_GRP1_PERIPH_DSI (*)
  1700. *
  1701. * (*) value not defined in all devices.
  1702. * @retval None
  1703. */
  1704. __STATIC_INLINE void LL_APB2_GRP1_DisableClock(uint32_t Periphs)
  1705. {
  1706. CLEAR_BIT(RCC->APB2ENR, Periphs);
  1707. }
  1708. /**
  1709. * @brief Force APB2 peripherals reset.
  1710. * @rmtoll APB2RSTR SYSCFGRST LL_APB2_GRP1_ForceReset\n
  1711. * APB2RSTR SDMMC1RST LL_APB2_GRP1_ForceReset\n
  1712. * APB2RSTR TIM1RST LL_APB2_GRP1_ForceReset\n
  1713. * APB2RSTR SPI1RST LL_APB2_GRP1_ForceReset\n
  1714. * APB2RSTR TIM8RST LL_APB2_GRP1_ForceReset\n
  1715. * APB2RSTR USART1RST LL_APB2_GRP1_ForceReset\n
  1716. * APB2RSTR TIM15RST LL_APB2_GRP1_ForceReset\n
  1717. * APB2RSTR TIM16RST LL_APB2_GRP1_ForceReset\n
  1718. * APB2RSTR TIM17RST LL_APB2_GRP1_ForceReset\n
  1719. * APB2RSTR SAI1RST LL_APB2_GRP1_ForceReset\n
  1720. * APB2RSTR SAI2RST LL_APB2_GRP1_ForceReset\n
  1721. * APB2RSTR DFSDM1RST LL_APB2_GRP1_ForceReset\n
  1722. * APB2RSTR LTDCRST LL_APB2_GRP1_ForceReset\n
  1723. * APB2RSTR DSIRST LL_APB2_GRP1_ForceReset
  1724. * @param Periphs This parameter can be a combination of the following values:
  1725. * @arg @ref LL_APB2_GRP1_PERIPH_ALL
  1726. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  1727. * @arg @ref LL_APB2_GRP1_PERIPH_SDMMC1 (*)
  1728. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  1729. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  1730. * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)
  1731. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  1732. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15
  1733. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  1734. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)
  1735. * @arg @ref LL_APB2_GRP1_PERIPH_SAI1
  1736. * @arg @ref LL_APB2_GRP1_PERIPH_SAI2 (*)
  1737. * @arg @ref LL_APB2_GRP1_PERIPH_DFSDM1 (*)
  1738. * @arg @ref LL_APB2_GRP1_PERIPH_LTDC (*)
  1739. * @arg @ref LL_APB2_GRP1_PERIPH_DSI (*)
  1740. *
  1741. * (*) value not defined in all devices.
  1742. * @retval None
  1743. */
  1744. __STATIC_INLINE void LL_APB2_GRP1_ForceReset(uint32_t Periphs)
  1745. {
  1746. SET_BIT(RCC->APB2RSTR, Periphs);
  1747. }
  1748. /**
  1749. * @brief Release APB2 peripherals reset.
  1750. * @rmtoll APB2RSTR SYSCFGRST LL_APB2_GRP1_ReleaseReset\n
  1751. * APB2RSTR SDMMC1RST LL_APB2_GRP1_ReleaseReset\n
  1752. * APB2RSTR TIM1RST LL_APB2_GRP1_ReleaseReset\n
  1753. * APB2RSTR SPI1RST LL_APB2_GRP1_ReleaseReset\n
  1754. * APB2RSTR TIM8RST LL_APB2_GRP1_ReleaseReset\n
  1755. * APB2RSTR USART1RST LL_APB2_GRP1_ReleaseReset\n
  1756. * APB2RSTR TIM15RST LL_APB2_GRP1_ReleaseReset\n
  1757. * APB2RSTR TIM16RST LL_APB2_GRP1_ReleaseReset\n
  1758. * APB2RSTR TIM17RST LL_APB2_GRP1_ReleaseReset\n
  1759. * APB2RSTR SAI1RST LL_APB2_GRP1_ReleaseReset\n
  1760. * APB2RSTR SAI2RST LL_APB2_GRP1_ReleaseReset\n
  1761. * APB2RSTR DFSDM1RST LL_APB2_GRP1_ReleaseReset\n
  1762. * APB2RSTR LTDCRST LL_APB2_GRP1_ReleaseReset\n
  1763. * APB2RSTR DSIRST LL_APB2_GRP1_ReleaseReset
  1764. * @param Periphs This parameter can be a combination of the following values:
  1765. * @arg @ref LL_APB2_GRP1_PERIPH_ALL
  1766. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  1767. * @arg @ref LL_APB2_GRP1_PERIPH_SDMMC1 (*)
  1768. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  1769. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  1770. * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)
  1771. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  1772. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15
  1773. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  1774. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)
  1775. * @arg @ref LL_APB2_GRP1_PERIPH_SAI1
  1776. * @arg @ref LL_APB2_GRP1_PERIPH_SAI2 (*)
  1777. * @arg @ref LL_APB2_GRP1_PERIPH_DFSDM1 (*)
  1778. * @arg @ref LL_APB2_GRP1_PERIPH_LTDC (*)
  1779. * @arg @ref LL_APB2_GRP1_PERIPH_DSI (*)
  1780. *
  1781. * (*) value not defined in all devices.
  1782. * @retval None
  1783. */
  1784. __STATIC_INLINE void LL_APB2_GRP1_ReleaseReset(uint32_t Periphs)
  1785. {
  1786. CLEAR_BIT(RCC->APB2RSTR, Periphs);
  1787. }
  1788. /**
  1789. * @brief Enable APB2 peripheral clocks in Sleep and Stop modes
  1790. * @rmtoll APB2SMENR SYSCFGSMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1791. * APB2SMENR SDMMC1SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1792. * APB2SMENR TIM1SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1793. * APB2SMENR SPI1SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1794. * APB2SMENR TIM8SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1795. * APB2SMENR USART1SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1796. * APB2SMENR TIM15SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1797. * APB2SMENR TIM16SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1798. * APB2SMENR TIM17SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1799. * APB2SMENR SAI1SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1800. * APB2SMENR SAI2SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1801. * APB2SMENR DFSDM1SMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1802. * APB2SMENR LTDCSMEN LL_APB2_GRP1_EnableClockStopSleep\n
  1803. * APB2SMENR DSISMEN LL_APB2_GRP1_EnableClockStopSleep
  1804. * @param Periphs This parameter can be a combination of the following values:
  1805. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  1806. * @arg @ref LL_APB2_GRP1_PERIPH_SDMMC1 (*)
  1807. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  1808. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  1809. * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)
  1810. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  1811. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15
  1812. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  1813. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)
  1814. * @arg @ref LL_APB2_GRP1_PERIPH_SAI1
  1815. * @arg @ref LL_APB2_GRP1_PERIPH_SAI2 (*)
  1816. * @arg @ref LL_APB2_GRP1_PERIPH_DFSDM1 (*)
  1817. * @arg @ref LL_APB2_GRP1_PERIPH_LTDC (*)
  1818. * @arg @ref LL_APB2_GRP1_PERIPH_DSI (*)
  1819. *
  1820. * (*) value not defined in all devices.
  1821. * @retval None
  1822. */
  1823. __STATIC_INLINE void LL_APB2_GRP1_EnableClockStopSleep(uint32_t Periphs)
  1824. {
  1825. __IO uint32_t tmpreg;
  1826. SET_BIT(RCC->APB2SMENR, Periphs);
  1827. /* Delay after an RCC peripheral clock enabling */
  1828. tmpreg = READ_BIT(RCC->APB2SMENR, Periphs);
  1829. (void)tmpreg;
  1830. }
  1831. /**
  1832. * @brief Disable APB2 peripheral clocks in Sleep and Stop modes
  1833. * @rmtoll APB2SMENR SYSCFGSMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1834. * APB2SMENR SDMMC1SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1835. * APB2SMENR TIM1SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1836. * APB2SMENR SPI1SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1837. * APB2SMENR TIM8SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1838. * APB2SMENR USART1SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1839. * APB2SMENR TIM15SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1840. * APB2SMENR TIM16SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1841. * APB2SMENR TIM17SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1842. * APB2SMENR SAI1SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1843. * APB2SMENR SAI2SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1844. * APB2SMENR DFSDM1SMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1845. * APB2SMENR LTDCSMEN LL_APB2_GRP1_DisableClockStopSleep\n
  1846. * APB2SMENR DSISMEN LL_APB2_GRP1_DisableClockStopSleep
  1847. * @param Periphs This parameter can be a combination of the following values:
  1848. * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG
  1849. * @arg @ref LL_APB2_GRP1_PERIPH_SDMMC1 (*)
  1850. * @arg @ref LL_APB2_GRP1_PERIPH_TIM1
  1851. * @arg @ref LL_APB2_GRP1_PERIPH_SPI1
  1852. * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)
  1853. * @arg @ref LL_APB2_GRP1_PERIPH_USART1
  1854. * @arg @ref LL_APB2_GRP1_PERIPH_TIM15
  1855. * @arg @ref LL_APB2_GRP1_PERIPH_TIM16
  1856. * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)
  1857. * @arg @ref LL_APB2_GRP1_PERIPH_SAI1
  1858. * @arg @ref LL_APB2_GRP1_PERIPH_SAI2 (*)
  1859. * @arg @ref LL_APB2_GRP1_PERIPH_DFSDM1 (*)
  1860. * @arg @ref LL_APB2_GRP1_PERIPH_LTDC (*)
  1861. * @arg @ref LL_APB2_GRP1_PERIPH_DSI (*)
  1862. *
  1863. * (*) value not defined in all devices.
  1864. * @retval None
  1865. */
  1866. __STATIC_INLINE void LL_APB2_GRP1_DisableClockStopSleep(uint32_t Periphs)
  1867. {
  1868. CLEAR_BIT(RCC->APB2SMENR, Periphs);
  1869. }
  1870. /**
  1871. * @}
  1872. */
  1873. /**
  1874. * @}
  1875. */
  1876. /**
  1877. * @}
  1878. */
  1879. #endif /* defined(RCC) */
  1880. /**
  1881. * @}
  1882. */
  1883. #ifdef __cplusplus
  1884. }
  1885. #endif
  1886. #endif /* __STM32L4xx_LL_BUS_H */
  1887. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/