2 ******************************************************************************
3 * @file stm32f1xx_ll_rcc.h
4 * @author MCD Application Team
7 * @brief Header file of RCC LL module.
8 ******************************************************************************
11 * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ******************************************************************************
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32F1xx_LL_RCC_H
40 #define __STM32F1xx_LL_RCC_H
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f1xx.h"
49 /** @addtogroup STM32F1xx_LL_Driver
55 /** @defgroup RCC_LL RCC
59 /* Private types -------------------------------------------------------------*/
60 /* Private variables ---------------------------------------------------------*/
61 /* Private constants ---------------------------------------------------------*/
62 /* Private macros ------------------------------------------------------------*/
63 #if defined(USE_FULL_LL_DRIVER)
64 /** @defgroup RCC_LL_Private_Macros RCC Private Macros
70 #endif /*USE_FULL_LL_DRIVER*/
71 /* Exported types ------------------------------------------------------------*/
72 #if defined(USE_FULL_LL_DRIVER)
73 /** @defgroup RCC_LL_Exported_Types RCC Exported Types
77 /** @defgroup LL_ES_CLOCK_FREQ Clocks Frequency Structure
82 * @brief RCC Clocks Frequency Structure
86 uint32_t SYSCLK_Frequency
; /*!< SYSCLK clock frequency */
87 uint32_t HCLK_Frequency
; /*!< HCLK clock frequency */
88 uint32_t PCLK1_Frequency
; /*!< PCLK1 clock frequency */
89 uint32_t PCLK2_Frequency
; /*!< PCLK2 clock frequency */
90 } LL_RCC_ClocksTypeDef
;
99 #endif /* USE_FULL_LL_DRIVER */
101 /* Exported constants --------------------------------------------------------*/
102 /** @defgroup RCC_LL_Exported_Constants RCC Exported Constants
106 /** @defgroup RCC_LL_EC_OSC_VALUES Oscillator Values adaptation
107 * @brief Defines used to adapt values of different oscillators
108 * @note These values could be modified in the user environment according to
112 #if !defined (HSE_VALUE)
113 #define HSE_VALUE 8000000U /*!< Value of the HSE oscillator in Hz */
114 #endif /* HSE_VALUE */
116 #if !defined (HSI_VALUE)
117 #define HSI_VALUE 8000000U /*!< Value of the HSI oscillator in Hz */
118 #endif /* HSI_VALUE */
120 #if !defined (LSE_VALUE)
121 #define LSE_VALUE 32768U /*!< Value of the LSE oscillator in Hz */
122 #endif /* LSE_VALUE */
124 #if !defined (LSI_VALUE)
125 #define LSI_VALUE 32000U /*!< Value of the LSI oscillator in Hz */
126 #endif /* LSI_VALUE */
131 /** @defgroup RCC_LL_EC_CLEAR_FLAG Clear Flags Defines
132 * @brief Flags defines which can be used with LL_RCC_WriteReg function
135 #define LL_RCC_CIR_LSIRDYC RCC_CIR_LSIRDYC /*!< LSI Ready Interrupt Clear */
136 #define LL_RCC_CIR_LSERDYC RCC_CIR_LSERDYC /*!< LSE Ready Interrupt Clear */
137 #define LL_RCC_CIR_HSIRDYC RCC_CIR_HSIRDYC /*!< HSI Ready Interrupt Clear */
138 #define LL_RCC_CIR_HSERDYC RCC_CIR_HSERDYC /*!< HSE Ready Interrupt Clear */
139 #define LL_RCC_CIR_PLLRDYC RCC_CIR_PLLRDYC /*!< PLL Ready Interrupt Clear */
140 #define LL_RCC_CIR_PLL3RDYC RCC_CIR_PLL3RDYC /*!< PLL3(PLLI2S) Ready Interrupt Clear */
141 #define LL_RCC_CIR_PLL2RDYC RCC_CIR_PLL2RDYC /*!< PLL2 Ready Interrupt Clear */
142 #define LL_RCC_CIR_CSSC RCC_CIR_CSSC /*!< Clock Security System Interrupt Clear */
147 /** @defgroup RCC_LL_EC_GET_FLAG Get Flags Defines
148 * @brief Flags defines which can be used with LL_RCC_ReadReg function
151 #define LL_RCC_CIR_LSIRDYF RCC_CIR_LSIRDYF /*!< LSI Ready Interrupt flag */
152 #define LL_RCC_CIR_LSERDYF RCC_CIR_LSERDYF /*!< LSE Ready Interrupt flag */
153 #define LL_RCC_CIR_HSIRDYF RCC_CIR_HSIRDYF /*!< HSI Ready Interrupt flag */
154 #define LL_RCC_CIR_HSERDYF RCC_CIR_HSERDYF /*!< HSE Ready Interrupt flag */
155 #define LL_RCC_CIR_PLLRDYF RCC_CIR_PLLRDYF /*!< PLL Ready Interrupt flag */
156 #define LL_RCC_CIR_PLL3RDYF RCC_CIR_PLL3RDYF /*!< PLL3(PLLI2S) Ready Interrupt flag */
157 #define LL_RCC_CIR_PLL2RDYF RCC_CIR_PLL2RDYF /*!< PLL2 Ready Interrupt flag */
158 #define LL_RCC_CIR_CSSF RCC_CIR_CSSF /*!< Clock Security System Interrupt flag */
159 #define LL_RCC_CSR_PINRSTF RCC_CSR_PINRSTF /*!< PIN reset flag */
160 #define LL_RCC_CSR_PORRSTF RCC_CSR_PORRSTF /*!< POR/PDR reset flag */
161 #define LL_RCC_CSR_SFTRSTF RCC_CSR_SFTRSTF /*!< Software Reset flag */
162 #define LL_RCC_CSR_IWDGRSTF RCC_CSR_IWDGRSTF /*!< Independent Watchdog reset flag */
163 #define LL_RCC_CSR_WWDGRSTF RCC_CSR_WWDGRSTF /*!< Window watchdog reset flag */
164 #define LL_RCC_CSR_LPWRRSTF RCC_CSR_LPWRRSTF /*!< Low-Power reset flag */
169 /** @defgroup RCC_LL_EC_IT IT Defines
170 * @brief IT defines which can be used with LL_RCC_ReadReg and LL_RCC_WriteReg functions
173 #define LL_RCC_CIR_LSIRDYIE RCC_CIR_LSIRDYIE /*!< LSI Ready Interrupt Enable */
174 #define LL_RCC_CIR_LSERDYIE RCC_CIR_LSERDYIE /*!< LSE Ready Interrupt Enable */
175 #define LL_RCC_CIR_HSIRDYIE RCC_CIR_HSIRDYIE /*!< HSI Ready Interrupt Enable */
176 #define LL_RCC_CIR_HSERDYIE RCC_CIR_HSERDYIE /*!< HSE Ready Interrupt Enable */
177 #define LL_RCC_CIR_PLLRDYIE RCC_CIR_PLLRDYIE /*!< PLL Ready Interrupt Enable */
178 #define LL_RCC_CIR_PLL3RDYIE RCC_CIR_PLL3RDYIE /*!< PLL3(PLLI2S) Ready Interrupt Enable */
179 #define LL_RCC_CIR_PLL2RDYIE RCC_CIR_PLL2RDYIE /*!< PLL2 Ready Interrupt Enable */
184 #if defined(RCC_CFGR2_PREDIV2)
185 /** @defgroup RCC_LL_EC_HSE_PREDIV2_DIV HSE PREDIV2 Division factor
188 #define LL_RCC_HSE_PREDIV2_DIV_1 RCC_CFGR2_PREDIV2_DIV1 /*!< PREDIV2 input clock not divided */
189 #define LL_RCC_HSE_PREDIV2_DIV_2 RCC_CFGR2_PREDIV2_DIV2 /*!< PREDIV2 input clock divided by 2 */
190 #define LL_RCC_HSE_PREDIV2_DIV_3 RCC_CFGR2_PREDIV2_DIV3 /*!< PREDIV2 input clock divided by 3 */
191 #define LL_RCC_HSE_PREDIV2_DIV_4 RCC_CFGR2_PREDIV2_DIV4 /*!< PREDIV2 input clock divided by 4 */
192 #define LL_RCC_HSE_PREDIV2_DIV_5 RCC_CFGR2_PREDIV2_DIV5 /*!< PREDIV2 input clock divided by 5 */
193 #define LL_RCC_HSE_PREDIV2_DIV_6 RCC_CFGR2_PREDIV2_DIV6 /*!< PREDIV2 input clock divided by 6 */
194 #define LL_RCC_HSE_PREDIV2_DIV_7 RCC_CFGR2_PREDIV2_DIV7 /*!< PREDIV2 input clock divided by 7 */
195 #define LL_RCC_HSE_PREDIV2_DIV_8 RCC_CFGR2_PREDIV2_DIV8 /*!< PREDIV2 input clock divided by 8 */
196 #define LL_RCC_HSE_PREDIV2_DIV_9 RCC_CFGR2_PREDIV2_DIV9 /*!< PREDIV2 input clock divided by 9 */
197 #define LL_RCC_HSE_PREDIV2_DIV_10 RCC_CFGR2_PREDIV2_DIV10 /*!< PREDIV2 input clock divided by 10 */
198 #define LL_RCC_HSE_PREDIV2_DIV_11 RCC_CFGR2_PREDIV2_DIV11 /*!< PREDIV2 input clock divided by 11 */
199 #define LL_RCC_HSE_PREDIV2_DIV_12 RCC_CFGR2_PREDIV2_DIV12 /*!< PREDIV2 input clock divided by 12 */
200 #define LL_RCC_HSE_PREDIV2_DIV_13 RCC_CFGR2_PREDIV2_DIV13 /*!< PREDIV2 input clock divided by 13 */
201 #define LL_RCC_HSE_PREDIV2_DIV_14 RCC_CFGR2_PREDIV2_DIV14 /*!< PREDIV2 input clock divided by 14 */
202 #define LL_RCC_HSE_PREDIV2_DIV_15 RCC_CFGR2_PREDIV2_DIV15 /*!< PREDIV2 input clock divided by 15 */
203 #define LL_RCC_HSE_PREDIV2_DIV_16 RCC_CFGR2_PREDIV2_DIV16 /*!< PREDIV2 input clock divided by 16 */
208 #endif /* RCC_CFGR2_PREDIV2 */
210 /** @defgroup RCC_LL_EC_SYS_CLKSOURCE System clock switch
213 #define LL_RCC_SYS_CLKSOURCE_HSI RCC_CFGR_SW_HSI /*!< HSI selection as system clock */
214 #define LL_RCC_SYS_CLKSOURCE_HSE RCC_CFGR_SW_HSE /*!< HSE selection as system clock */
215 #define LL_RCC_SYS_CLKSOURCE_PLL RCC_CFGR_SW_PLL /*!< PLL selection as system clock */
220 /** @defgroup RCC_LL_EC_SYS_CLKSOURCE_STATUS System clock switch status
223 #define LL_RCC_SYS_CLKSOURCE_STATUS_HSI RCC_CFGR_SWS_HSI /*!< HSI used as system clock */
224 #define LL_RCC_SYS_CLKSOURCE_STATUS_HSE RCC_CFGR_SWS_HSE /*!< HSE used as system clock */
225 #define LL_RCC_SYS_CLKSOURCE_STATUS_PLL RCC_CFGR_SWS_PLL /*!< PLL used as system clock */
230 /** @defgroup RCC_LL_EC_SYSCLK_DIV AHB prescaler
233 #define LL_RCC_SYSCLK_DIV_1 RCC_CFGR_HPRE_DIV1 /*!< SYSCLK not divided */
234 #define LL_RCC_SYSCLK_DIV_2 RCC_CFGR_HPRE_DIV2 /*!< SYSCLK divided by 2 */
235 #define LL_RCC_SYSCLK_DIV_4 RCC_CFGR_HPRE_DIV4 /*!< SYSCLK divided by 4 */
236 #define LL_RCC_SYSCLK_DIV_8 RCC_CFGR_HPRE_DIV8 /*!< SYSCLK divided by 8 */
237 #define LL_RCC_SYSCLK_DIV_16 RCC_CFGR_HPRE_DIV16 /*!< SYSCLK divided by 16 */
238 #define LL_RCC_SYSCLK_DIV_64 RCC_CFGR_HPRE_DIV64 /*!< SYSCLK divided by 64 */
239 #define LL_RCC_SYSCLK_DIV_128 RCC_CFGR_HPRE_DIV128 /*!< SYSCLK divided by 128 */
240 #define LL_RCC_SYSCLK_DIV_256 RCC_CFGR_HPRE_DIV256 /*!< SYSCLK divided by 256 */
241 #define LL_RCC_SYSCLK_DIV_512 RCC_CFGR_HPRE_DIV512 /*!< SYSCLK divided by 512 */
246 /** @defgroup RCC_LL_EC_APB1_DIV APB low-speed prescaler (APB1)
249 #define LL_RCC_APB1_DIV_1 RCC_CFGR_PPRE1_DIV1 /*!< HCLK not divided */
250 #define LL_RCC_APB1_DIV_2 RCC_CFGR_PPRE1_DIV2 /*!< HCLK divided by 2 */
251 #define LL_RCC_APB1_DIV_4 RCC_CFGR_PPRE1_DIV4 /*!< HCLK divided by 4 */
252 #define LL_RCC_APB1_DIV_8 RCC_CFGR_PPRE1_DIV8 /*!< HCLK divided by 8 */
253 #define LL_RCC_APB1_DIV_16 RCC_CFGR_PPRE1_DIV16 /*!< HCLK divided by 16 */
258 /** @defgroup RCC_LL_EC_APB2_DIV APB high-speed prescaler (APB2)
261 #define LL_RCC_APB2_DIV_1 RCC_CFGR_PPRE2_DIV1 /*!< HCLK not divided */
262 #define LL_RCC_APB2_DIV_2 RCC_CFGR_PPRE2_DIV2 /*!< HCLK divided by 2 */
263 #define LL_RCC_APB2_DIV_4 RCC_CFGR_PPRE2_DIV4 /*!< HCLK divided by 4 */
264 #define LL_RCC_APB2_DIV_8 RCC_CFGR_PPRE2_DIV8 /*!< HCLK divided by 8 */
265 #define LL_RCC_APB2_DIV_16 RCC_CFGR_PPRE2_DIV16 /*!< HCLK divided by 16 */
270 /** @defgroup RCC_LL_EC_MCO1SOURCE MCO1 SOURCE selection
273 #define LL_RCC_MCO1SOURCE_NOCLOCK RCC_CFGR_MCOSEL_NOCLOCK /*!< MCO output disabled, no clock on MCO */
274 #define LL_RCC_MCO1SOURCE_SYSCLK RCC_CFGR_MCOSEL_SYSCLK /*!< SYSCLK selection as MCO source */
275 #define LL_RCC_MCO1SOURCE_HSI RCC_CFGR_MCOSEL_HSI /*!< HSI selection as MCO source */
276 #define LL_RCC_MCO1SOURCE_HSE RCC_CFGR_MCOSEL_HSE /*!< HSE selection as MCO source */
277 #define LL_RCC_MCO1SOURCE_PLLCLK_DIV_2 RCC_CFGR_MCOSEL_PLL_DIV2 /*!< PLL clock divided by 2*/
278 #if defined(RCC_CFGR_MCOSEL_PLL2CLK)
279 #define LL_RCC_MCO1SOURCE_PLL2CLK RCC_CFGR_MCOSEL_PLL2 /*!< PLL2 clock selected as MCO source*/
280 #endif /* RCC_CFGR_MCOSEL_PLL2CLK */
281 #if defined(RCC_CFGR_MCOSEL_PLL3CLK_DIV2)
282 #define LL_RCC_MCO1SOURCE_PLLI2SCLK_DIV2 RCC_CFGR_MCOSEL_PLL3_DIV2 /*!< PLLI2S clock divided by 2 selected as MCO source*/
283 #endif /* RCC_CFGR_MCOSEL_PLL3CLK_DIV2 */
284 #if defined(RCC_CFGR_MCOSEL_EXT_HSE)
285 #define LL_RCC_MCO1SOURCE_EXT_HSE RCC_CFGR_MCOSEL_EXT_HSE /*!< XT1 external 3-25 MHz oscillator clock selected as MCO source */
286 #endif /* RCC_CFGR_MCOSEL_EXT_HSE */
287 #if defined(RCC_CFGR_MCOSEL_PLL3CLK)
288 #define LL_RCC_MCO1SOURCE_PLLI2SCLK RCC_CFGR_MCOSEL_PLL3CLK /*!< PLLI2S clock selected as MCO source */
289 #endif /* RCC_CFGR_MCOSEL_PLL3CLK */
294 #if defined(USE_FULL_LL_DRIVER)
295 /** @defgroup RCC_LL_EC_PERIPH_FREQUENCY Peripheral clock frequency
298 #define LL_RCC_PERIPH_FREQUENCY_NO 0x00000000U /*!< No clock enabled for the peripheral */
299 #define LL_RCC_PERIPH_FREQUENCY_NA 0xFFFFFFFFU /*!< Frequency cannot be provided as external clock */
303 #endif /* USE_FULL_LL_DRIVER */
305 #if defined(RCC_CFGR2_I2S2SRC)
306 /** @defgroup RCC_LL_EC_I2S2CLKSOURCE Peripheral I2S clock source selection
309 #define LL_RCC_I2S2_CLKSOURCE_SYSCLK RCC_CFGR2_I2S2SRC /*!< System clock (SYSCLK) selected as I2S2 clock entry */
310 #define LL_RCC_I2S2_CLKSOURCE_PLLI2S_VCO (uint32_t)(RCC_CFGR2_I2S2SRC | (RCC_CFGR2_I2S2SRC >> 16U)) /*!< PLLI2S VCO clock selected as I2S2 clock entry */
311 #define LL_RCC_I2S3_CLKSOURCE_SYSCLK RCC_CFGR2_I2S3SRC /*!< System clock (SYSCLK) selected as I2S3 clock entry */
312 #define LL_RCC_I2S3_CLKSOURCE_PLLI2S_VCO (uint32_t)(RCC_CFGR2_I2S3SRC | (RCC_CFGR2_I2S3SRC >> 16U)) /*!< PLLI2S VCO clock selected as I2S3 clock entry */
316 #endif /* RCC_CFGR2_I2S2SRC */
318 #if defined(USB_OTG_FS) || defined(USB)
319 /** @defgroup RCC_LL_EC_USB_CLKSOURCE Peripheral USB clock source selection
322 #if defined(RCC_CFGR_USBPRE)
323 #define LL_RCC_USB_CLKSOURCE_PLL RCC_CFGR_USBPRE /*!< PLL clock is not divided */
324 #define LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5 0x00000000U /*!< PLL clock is divided by 1.5 */
325 #endif /*RCC_CFGR_USBPRE*/
326 #if defined(RCC_CFGR_OTGFSPRE)
327 #define LL_RCC_USB_CLKSOURCE_PLL_DIV_2 RCC_CFGR_OTGFSPRE /*!< PLL clock is divided by 2 */
328 #define LL_RCC_USB_CLKSOURCE_PLL_DIV_3 0x00000000U /*!< PLL clock is divided by 3 */
329 #endif /*RCC_CFGR_OTGFSPRE*/
333 #endif /* USB_OTG_FS || USB */
335 /** @defgroup RCC_LL_EC_ADC_CLKSOURCE_PCLK2 Peripheral ADC clock source selection
338 #define LL_RCC_ADC_CLKSRC_PCLK2_DIV_2 RCC_CFGR_ADCPRE_DIV2 /*ADC prescaler PCLK2 divided by 2*/
339 #define LL_RCC_ADC_CLKSRC_PCLK2_DIV_4 RCC_CFGR_ADCPRE_DIV4 /*ADC prescaler PCLK2 divided by 4*/
340 #define LL_RCC_ADC_CLKSRC_PCLK2_DIV_6 RCC_CFGR_ADCPRE_DIV6 /*ADC prescaler PCLK2 divided by 6*/
341 #define LL_RCC_ADC_CLKSRC_PCLK2_DIV_8 RCC_CFGR_ADCPRE_DIV8 /*ADC prescaler PCLK2 divided by 8*/
346 #if defined(RCC_CFGR2_I2S2SRC)
347 /** @defgroup RCC_LL_EC_I2S2 Peripheral I2S get clock source
350 #define LL_RCC_I2S2_CLKSOURCE RCC_CFGR2_I2S2SRC /*!< I2S2 Clock source selection */
351 #define LL_RCC_I2S3_CLKSOURCE RCC_CFGR2_I2S3SRC /*!< I2S3 Clock source selection */
356 #endif /* RCC_CFGR2_I2S2SRC */
358 #if defined(USB_OTG_FS) || defined(USB)
359 /** @defgroup RCC_LL_EC_USB Peripheral USB get clock source
362 #define LL_RCC_USB_CLKSOURCE 0x00400000U /*!< USB Clock source selection */
367 #endif /* USB_OTG_FS || USB */
369 /** @defgroup RCC_LL_EC_ADC Peripheral ADC get clock source
372 #define LL_RCC_ADC_CLKSOURCE RCC_CFGR_ADCPRE /*!< ADC Clock source selection */
377 /** @defgroup RCC_LL_EC_RTC_CLKSOURCE RTC clock source selection
380 #define LL_RCC_RTC_CLKSOURCE_NONE 0x00000000U /*!< No clock used as RTC clock */
381 #define LL_RCC_RTC_CLKSOURCE_LSE RCC_BDCR_RTCSEL_0 /*!< LSE oscillator clock used as RTC clock */
382 #define LL_RCC_RTC_CLKSOURCE_LSI RCC_BDCR_RTCSEL_1 /*!< LSI oscillator clock used as RTC clock */
383 #define LL_RCC_RTC_CLKSOURCE_HSE_DIV128 RCC_BDCR_RTCSEL /*!< HSE oscillator clock divided by 128 used as RTC clock */
388 /** @defgroup RCC_LL_EC_PLL_MUL PLL Multiplicator factor
391 #if defined(RCC_CFGR_PLLMULL2)
392 #define LL_RCC_PLL_MUL_2 RCC_CFGR_PLLMULL2 /*!< PLL input clock*2 */
393 #endif /*RCC_CFGR_PLLMULL2*/
394 #if defined(RCC_CFGR_PLLMULL3)
395 #define LL_RCC_PLL_MUL_3 RCC_CFGR_PLLMULL3 /*!< PLL input clock*3 */
396 #endif /*RCC_CFGR_PLLMULL3*/
397 #define LL_RCC_PLL_MUL_4 RCC_CFGR_PLLMULL4 /*!< PLL input clock*4 */
398 #define LL_RCC_PLL_MUL_5 RCC_CFGR_PLLMULL5 /*!< PLL input clock*5 */
399 #define LL_RCC_PLL_MUL_6 RCC_CFGR_PLLMULL6 /*!< PLL input clock*6 */
400 #define LL_RCC_PLL_MUL_7 RCC_CFGR_PLLMULL7 /*!< PLL input clock*7 */
401 #define LL_RCC_PLL_MUL_8 RCC_CFGR_PLLMULL8 /*!< PLL input clock*8 */
402 #define LL_RCC_PLL_MUL_9 RCC_CFGR_PLLMULL9 /*!< PLL input clock*9 */
403 #if defined(RCC_CFGR_PLLMULL6_5)
404 #define LL_RCC_PLL_MUL_6_5 RCC_CFGR_PLLMULL6_5 /*!< PLL input clock*6 */
406 #define LL_RCC_PLL_MUL_10 RCC_CFGR_PLLMULL10 /*!< PLL input clock*10 */
407 #define LL_RCC_PLL_MUL_11 RCC_CFGR_PLLMULL11 /*!< PLL input clock*11 */
408 #define LL_RCC_PLL_MUL_12 RCC_CFGR_PLLMULL12 /*!< PLL input clock*12 */
409 #define LL_RCC_PLL_MUL_13 RCC_CFGR_PLLMULL13 /*!< PLL input clock*13 */
410 #define LL_RCC_PLL_MUL_14 RCC_CFGR_PLLMULL14 /*!< PLL input clock*14 */
411 #define LL_RCC_PLL_MUL_15 RCC_CFGR_PLLMULL15 /*!< PLL input clock*15 */
412 #define LL_RCC_PLL_MUL_16 RCC_CFGR_PLLMULL16 /*!< PLL input clock*16 */
413 #endif /*RCC_CFGR_PLLMULL6_5*/
418 /** @defgroup RCC_LL_EC_PLLSOURCE PLL SOURCE
421 #define LL_RCC_PLLSOURCE_HSI_DIV_2 0x00000000U /*!< HSI clock divided by 2 selected as PLL entry clock source */
422 #define LL_RCC_PLLSOURCE_HSE RCC_CFGR_PLLSRC /*!< HSE/PREDIV1 clock selected as PLL entry clock source */
423 #if defined(RCC_CFGR2_PREDIV1SRC)
424 #define LL_RCC_PLLSOURCE_PLL2 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/PREDIV1 clock selected as PLL entry clock source */
425 #endif /*RCC_CFGR2_PREDIV1SRC*/
427 #define LL_RCC_PLLSOURCE_HSE_DIV_1 RCC_CFGR_PLLSRC /*!< HSE clock selected as PLL entry clock source */
428 #if defined(RCC_CFGR2_PREDIV1)
429 #define LL_RCC_PLLSOURCE_HSE_DIV_2 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV2) /*!< HSE/2 clock selected as PLL entry clock source */
430 #define LL_RCC_PLLSOURCE_HSE_DIV_3 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV3) /*!< HSE/3 clock selected as PLL entry clock source */
431 #define LL_RCC_PLLSOURCE_HSE_DIV_4 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV4) /*!< HSE/4 clock selected as PLL entry clock source */
432 #define LL_RCC_PLLSOURCE_HSE_DIV_5 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV5) /*!< HSE/5 clock selected as PLL entry clock source */
433 #define LL_RCC_PLLSOURCE_HSE_DIV_6 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV6) /*!< HSE/6 clock selected as PLL entry clock source */
434 #define LL_RCC_PLLSOURCE_HSE_DIV_7 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV7) /*!< HSE/7 clock selected as PLL entry clock source */
435 #define LL_RCC_PLLSOURCE_HSE_DIV_8 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV8) /*!< HSE/8 clock selected as PLL entry clock source */
436 #define LL_RCC_PLLSOURCE_HSE_DIV_9 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV9) /*!< HSE/9 clock selected as PLL entry clock source */
437 #define LL_RCC_PLLSOURCE_HSE_DIV_10 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV10) /*!< HSE/10 clock selected as PLL entry clock source */
438 #define LL_RCC_PLLSOURCE_HSE_DIV_11 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV11) /*!< HSE/11 clock selected as PLL entry clock source */
439 #define LL_RCC_PLLSOURCE_HSE_DIV_12 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV12) /*!< HSE/12 clock selected as PLL entry clock source */
440 #define LL_RCC_PLLSOURCE_HSE_DIV_13 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV13) /*!< HSE/13 clock selected as PLL entry clock source */
441 #define LL_RCC_PLLSOURCE_HSE_DIV_14 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV14) /*!< HSE/14 clock selected as PLL entry clock source */
442 #define LL_RCC_PLLSOURCE_HSE_DIV_15 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV15) /*!< HSE/15 clock selected as PLL entry clock source */
443 #define LL_RCC_PLLSOURCE_HSE_DIV_16 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV16) /*!< HSE/16 clock selected as PLL entry clock source */
444 #if defined(RCC_CFGR2_PREDIV1SRC)
445 #define LL_RCC_PLLSOURCE_PLL2_DIV_2 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV2 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/2 clock selected as PLL entry clock source */
446 #define LL_RCC_PLLSOURCE_PLL2_DIV_3 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV3 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/3 clock selected as PLL entry clock source */
447 #define LL_RCC_PLLSOURCE_PLL2_DIV_4 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV4 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/4 clock selected as PLL entry clock source */
448 #define LL_RCC_PLLSOURCE_PLL2_DIV_5 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV5 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/5 clock selected as PLL entry clock source */
449 #define LL_RCC_PLLSOURCE_PLL2_DIV_6 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV6 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/6 clock selected as PLL entry clock source */
450 #define LL_RCC_PLLSOURCE_PLL2_DIV_7 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV7 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/7 clock selected as PLL entry clock source */
451 #define LL_RCC_PLLSOURCE_PLL2_DIV_8 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV8 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/8 clock selected as PLL entry clock source */
452 #define LL_RCC_PLLSOURCE_PLL2_DIV_9 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV9 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/9 clock selected as PLL entry clock source */
453 #define LL_RCC_PLLSOURCE_PLL2_DIV_10 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV10 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/10 clock selected as PLL entry clock source */
454 #define LL_RCC_PLLSOURCE_PLL2_DIV_11 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV11 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/11 clock selected as PLL entry clock source */
455 #define LL_RCC_PLLSOURCE_PLL2_DIV_12 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV12 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/12 clock selected as PLL entry clock source */
456 #define LL_RCC_PLLSOURCE_PLL2_DIV_13 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV13 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/13 clock selected as PLL entry clock source */
457 #define LL_RCC_PLLSOURCE_PLL2_DIV_14 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV14 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/14 clock selected as PLL entry clock source */
458 #define LL_RCC_PLLSOURCE_PLL2_DIV_15 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV15 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/15 clock selected as PLL entry clock source */
459 #define LL_RCC_PLLSOURCE_PLL2_DIV_16 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV16 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/16 clock selected as PLL entry clock source */
460 #endif /*RCC_CFGR2_PREDIV1SRC*/
462 #define LL_RCC_PLLSOURCE_HSE_DIV_2 (RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE) /*!< HSE/2 clock selected as PLL entry clock source */
463 #endif /*RCC_CFGR2_PREDIV1*/
468 /** @defgroup RCC_LL_EC_PREDIV_DIV PREDIV Division factor
471 #if defined(RCC_CFGR2_PREDIV1)
472 #define LL_RCC_PREDIV_DIV_1 RCC_CFGR2_PREDIV1_DIV1 /*!< PREDIV1 input clock not divided */
473 #define LL_RCC_PREDIV_DIV_2 RCC_CFGR2_PREDIV1_DIV2 /*!< PREDIV1 input clock divided by 2 */
474 #define LL_RCC_PREDIV_DIV_3 RCC_CFGR2_PREDIV1_DIV3 /*!< PREDIV1 input clock divided by 3 */
475 #define LL_RCC_PREDIV_DIV_4 RCC_CFGR2_PREDIV1_DIV4 /*!< PREDIV1 input clock divided by 4 */
476 #define LL_RCC_PREDIV_DIV_5 RCC_CFGR2_PREDIV1_DIV5 /*!< PREDIV1 input clock divided by 5 */
477 #define LL_RCC_PREDIV_DIV_6 RCC_CFGR2_PREDIV1_DIV6 /*!< PREDIV1 input clock divided by 6 */
478 #define LL_RCC_PREDIV_DIV_7 RCC_CFGR2_PREDIV1_DIV7 /*!< PREDIV1 input clock divided by 7 */
479 #define LL_RCC_PREDIV_DIV_8 RCC_CFGR2_PREDIV1_DIV8 /*!< PREDIV1 input clock divided by 8 */
480 #define LL_RCC_PREDIV_DIV_9 RCC_CFGR2_PREDIV1_DIV9 /*!< PREDIV1 input clock divided by 9 */
481 #define LL_RCC_PREDIV_DIV_10 RCC_CFGR2_PREDIV1_DIV10 /*!< PREDIV1 input clock divided by 10 */
482 #define LL_RCC_PREDIV_DIV_11 RCC_CFGR2_PREDIV1_DIV11 /*!< PREDIV1 input clock divided by 11 */
483 #define LL_RCC_PREDIV_DIV_12 RCC_CFGR2_PREDIV1_DIV12 /*!< PREDIV1 input clock divided by 12 */
484 #define LL_RCC_PREDIV_DIV_13 RCC_CFGR2_PREDIV1_DIV13 /*!< PREDIV1 input clock divided by 13 */
485 #define LL_RCC_PREDIV_DIV_14 RCC_CFGR2_PREDIV1_DIV14 /*!< PREDIV1 input clock divided by 14 */
486 #define LL_RCC_PREDIV_DIV_15 RCC_CFGR2_PREDIV1_DIV15 /*!< PREDIV1 input clock divided by 15 */
487 #define LL_RCC_PREDIV_DIV_16 RCC_CFGR2_PREDIV1_DIV16 /*!< PREDIV1 input clock divided by 16 */
489 #define LL_RCC_PREDIV_DIV_1 0x00000000U /*!< HSE divider clock clock not divided */
490 #define LL_RCC_PREDIV_DIV_2 RCC_CFGR_PLLXTPRE /*!< HSE divider clock divided by 2 for PLL entry */
491 #endif /*RCC_CFGR2_PREDIV1*/
496 #if defined(RCC_PLLI2S_SUPPORT)
497 /** @defgroup RCC_LL_EC_PLLI2S_MUL PLLI2S MUL
500 #define LL_RCC_PLLI2S_MUL_8 RCC_CFGR2_PLL3MUL8 /*!< PLLI2S input clock * 8 */
501 #define LL_RCC_PLLI2S_MUL_9 RCC_CFGR2_PLL3MUL9 /*!< PLLI2S input clock * 9 */
502 #define LL_RCC_PLLI2S_MUL_10 RCC_CFGR2_PLL3MUL10 /*!< PLLI2S input clock * 10 */
503 #define LL_RCC_PLLI2S_MUL_11 RCC_CFGR2_PLL3MUL11 /*!< PLLI2S input clock * 11 */
504 #define LL_RCC_PLLI2S_MUL_12 RCC_CFGR2_PLL3MUL12 /*!< PLLI2S input clock * 12 */
505 #define LL_RCC_PLLI2S_MUL_13 RCC_CFGR2_PLL3MUL13 /*!< PLLI2S input clock * 13 */
506 #define LL_RCC_PLLI2S_MUL_14 RCC_CFGR2_PLL3MUL14 /*!< PLLI2S input clock * 14 */
507 #define LL_RCC_PLLI2S_MUL_16 RCC_CFGR2_PLL3MUL16 /*!< PLLI2S input clock * 16 */
508 #define LL_RCC_PLLI2S_MUL_20 RCC_CFGR2_PLL3MUL20 /*!< PLLI2S input clock * 20 */
513 #endif /* RCC_PLLI2S_SUPPORT */
515 #if defined(RCC_PLL2_SUPPORT)
516 /** @defgroup RCC_LL_EC_PLL2_MUL PLL2 MUL
519 #define LL_RCC_PLL2_MUL_8 RCC_CFGR2_PLL2MUL8 /*!< PLL2 input clock * 8 */
520 #define LL_RCC_PLL2_MUL_9 RCC_CFGR2_PLL2MUL9 /*!< PLL2 input clock * 9 */
521 #define LL_RCC_PLL2_MUL_10 RCC_CFGR2_PLL2MUL10 /*!< PLL2 input clock * 10 */
522 #define LL_RCC_PLL2_MUL_11 RCC_CFGR2_PLL2MUL11 /*!< PLL2 input clock * 11 */
523 #define LL_RCC_PLL2_MUL_12 RCC_CFGR2_PLL2MUL12 /*!< PLL2 input clock * 12 */
524 #define LL_RCC_PLL2_MUL_13 RCC_CFGR2_PLL2MUL13 /*!< PLL2 input clock * 13 */
525 #define LL_RCC_PLL2_MUL_14 RCC_CFGR2_PLL2MUL14 /*!< PLL2 input clock * 14 */
526 #define LL_RCC_PLL2_MUL_16 RCC_CFGR2_PLL2MUL16 /*!< PLL2 input clock * 16 */
527 #define LL_RCC_PLL2_MUL_20 RCC_CFGR2_PLL2MUL20 /*!< PLL2 input clock * 20 */
532 #endif /* RCC_PLL2_SUPPORT */
538 /* Exported macro ------------------------------------------------------------*/
539 /** @defgroup RCC_LL_Exported_Macros RCC Exported Macros
543 /** @defgroup RCC_LL_EM_WRITE_READ Common Write and read registers Macros
548 * @brief Write a value in RCC register
549 * @param __REG__ Register to be written
550 * @param __VALUE__ Value to be written in the register
553 #define LL_RCC_WriteReg(__REG__, __VALUE__) WRITE_REG(RCC->__REG__, (__VALUE__))
556 * @brief Read a value in RCC register
557 * @param __REG__ Register to be read
558 * @retval Register value
560 #define LL_RCC_ReadReg(__REG__) READ_REG(RCC->__REG__)
565 /** @defgroup RCC_LL_EM_CALC_FREQ Calculate frequencies
569 #if defined(RCC_CFGR_PLLMULL6_5)
571 * @brief Helper macro to calculate the PLLCLK frequency
572 * @note ex: @ref __LL_RCC_CALC_PLLCLK_FREQ (HSE_VALUE / (@ref LL_RCC_PLL_GetPrediv () + 1), @ref LL_RCC_PLL_GetMultiplicator());
573 * @param __INPUTFREQ__ PLL Input frequency (based on HSE div Prediv1 / HSI div 2 / PLL2 div Prediv1)
574 * @param __PLLMUL__: This parameter can be one of the following values:
575 * @arg @ref LL_RCC_PLL_MUL_4
576 * @arg @ref LL_RCC_PLL_MUL_5
577 * @arg @ref LL_RCC_PLL_MUL_6
578 * @arg @ref LL_RCC_PLL_MUL_7
579 * @arg @ref LL_RCC_PLL_MUL_8
580 * @arg @ref LL_RCC_PLL_MUL_9
581 * @arg @ref LL_RCC_PLL_MUL_6_5
582 * @retval PLL clock frequency (in Hz)
584 #define __LL_RCC_CALC_PLLCLK_FREQ(__INPUTFREQ__, __PLLMUL__) \
585 (((__PLLMUL__) != RCC_CFGR_PLLMULL6_5) ? \
586 ((__INPUTFREQ__) * ((((__PLLMUL__) & RCC_CFGR_PLLMULL) >> RCC_CFGR_PLLMULL_Pos) + 2U)) :\
587 (((__INPUTFREQ__) * 13U) / 2U))
591 * @brief Helper macro to calculate the PLLCLK frequency
592 * @note ex: @ref __LL_RCC_CALC_PLLCLK_FREQ (HSE_VALUE / (@ref LL_RCC_PLL_GetPrediv () + 1), @ref LL_RCC_PLL_GetMultiplicator ());
593 * @param __INPUTFREQ__ PLL Input frequency (based on HSE div Prediv1 or div 2 / HSI div 2)
594 * @param __PLLMUL__: This parameter can be one of the following values:
595 * @arg @ref LL_RCC_PLL_MUL_2
596 * @arg @ref LL_RCC_PLL_MUL_3
597 * @arg @ref LL_RCC_PLL_MUL_4
598 * @arg @ref LL_RCC_PLL_MUL_5
599 * @arg @ref LL_RCC_PLL_MUL_6
600 * @arg @ref LL_RCC_PLL_MUL_7
601 * @arg @ref LL_RCC_PLL_MUL_8
602 * @arg @ref LL_RCC_PLL_MUL_9
603 * @arg @ref LL_RCC_PLL_MUL_10
604 * @arg @ref LL_RCC_PLL_MUL_11
605 * @arg @ref LL_RCC_PLL_MUL_12
606 * @arg @ref LL_RCC_PLL_MUL_13
607 * @arg @ref LL_RCC_PLL_MUL_14
608 * @arg @ref LL_RCC_PLL_MUL_15
609 * @arg @ref LL_RCC_PLL_MUL_16
610 * @retval PLL clock frequency (in Hz)
612 #define __LL_RCC_CALC_PLLCLK_FREQ(__INPUTFREQ__, __PLLMUL__) ((__INPUTFREQ__) * (((__PLLMUL__) >> RCC_CFGR_PLLMULL_Pos) + 2U))
613 #endif /* RCC_CFGR_PLLMULL6_5 */
615 #if defined(RCC_PLLI2S_SUPPORT)
617 * @brief Helper macro to calculate the PLLI2S frequency
618 * @note ex: @ref __LL_RCC_CALC_PLLI2SCLK_FREQ (HSE_VALUE, @ref LL_RCC_PLLI2S_GetMultiplicator (), @ref LL_RCC_HSE_GetPrediv2 ());
619 * @param __INPUTFREQ__ PLLI2S Input frequency (based on HSE value)
620 * @param __PLLI2SMUL__: This parameter can be one of the following values:
621 * @arg @ref LL_RCC_PLLI2S_MUL_8
622 * @arg @ref LL_RCC_PLLI2S_MUL_9
623 * @arg @ref LL_RCC_PLLI2S_MUL_10
624 * @arg @ref LL_RCC_PLLI2S_MUL_11
625 * @arg @ref LL_RCC_PLLI2S_MUL_12
626 * @arg @ref LL_RCC_PLLI2S_MUL_13
627 * @arg @ref LL_RCC_PLLI2S_MUL_14
628 * @arg @ref LL_RCC_PLLI2S_MUL_16
629 * @arg @ref LL_RCC_PLLI2S_MUL_20
630 * @param __PLLI2SDIV__: This parameter can be one of the following values:
631 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_1
632 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_2
633 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_3
634 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_4
635 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_5
636 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_6
637 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_7
638 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_8
639 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_9
640 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_10
641 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_11
642 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_12
643 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_13
644 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_14
645 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_15
646 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_16
647 * @retval PLLI2S clock frequency (in Hz)
649 #define __LL_RCC_CALC_PLLI2SCLK_FREQ(__INPUTFREQ__, __PLLI2SMUL__, __PLLI2SDIV__) (((__INPUTFREQ__) * (((__PLLI2SMUL__) >> RCC_CFGR2_PLL3MUL_Pos) + 2U)) / (((__PLLI2SDIV__) >> RCC_CFGR2_PREDIV2_Pos) + 1U))
650 #endif /* RCC_PLLI2S_SUPPORT */
652 #if defined(RCC_PLL2_SUPPORT)
654 * @brief Helper macro to calculate the PLL2 frequency
655 * @note ex: @ref __LL_RCC_CALC_PLL2CLK_FREQ (HSE_VALUE, @ref LL_RCC_PLL2_GetMultiplicator (), @ref LL_RCC_HSE_GetPrediv2 ());
656 * @param __INPUTFREQ__ PLL2 Input frequency (based on HSE value)
657 * @param __PLL2MUL__: This parameter can be one of the following values:
658 * @arg @ref LL_RCC_PLL2_MUL_8
659 * @arg @ref LL_RCC_PLL2_MUL_9
660 * @arg @ref LL_RCC_PLL2_MUL_10
661 * @arg @ref LL_RCC_PLL2_MUL_11
662 * @arg @ref LL_RCC_PLL2_MUL_12
663 * @arg @ref LL_RCC_PLL2_MUL_13
664 * @arg @ref LL_RCC_PLL2_MUL_14
665 * @arg @ref LL_RCC_PLL2_MUL_16
666 * @arg @ref LL_RCC_PLL2_MUL_20
667 * @param __PLL2DIV__: This parameter can be one of the following values:
668 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_1
669 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_2
670 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_3
671 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_4
672 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_5
673 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_6
674 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_7
675 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_8
676 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_9
677 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_10
678 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_11
679 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_12
680 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_13
681 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_14
682 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_15
683 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_16
684 * @retval PLL2 clock frequency (in Hz)
686 #define __LL_RCC_CALC_PLL2CLK_FREQ(__INPUTFREQ__, __PLL2MUL__, __PLL2DIV__) (((__INPUTFREQ__) * (((__PLL2MUL__) >> RCC_CFGR2_PLL2MUL_Pos) + 2U)) / (((__PLL2DIV__) >> RCC_CFGR2_PREDIV2_Pos) + 1U))
687 #endif /* RCC_PLL2_SUPPORT */
690 * @brief Helper macro to calculate the HCLK frequency
691 * @note: __AHBPRESCALER__ be retrieved by @ref LL_RCC_GetAHBPrescaler
692 * ex: __LL_RCC_CALC_HCLK_FREQ(LL_RCC_GetAHBPrescaler())
693 * @param __SYSCLKFREQ__ SYSCLK frequency (based on HSE/HSI/PLLCLK)
694 * @param __AHBPRESCALER__: This parameter can be one of the following values:
695 * @arg @ref LL_RCC_SYSCLK_DIV_1
696 * @arg @ref LL_RCC_SYSCLK_DIV_2
697 * @arg @ref LL_RCC_SYSCLK_DIV_4
698 * @arg @ref LL_RCC_SYSCLK_DIV_8
699 * @arg @ref LL_RCC_SYSCLK_DIV_16
700 * @arg @ref LL_RCC_SYSCLK_DIV_64
701 * @arg @ref LL_RCC_SYSCLK_DIV_128
702 * @arg @ref LL_RCC_SYSCLK_DIV_256
703 * @arg @ref LL_RCC_SYSCLK_DIV_512
704 * @retval HCLK clock frequency (in Hz)
706 #define __LL_RCC_CALC_HCLK_FREQ(__SYSCLKFREQ__, __AHBPRESCALER__) ((__SYSCLKFREQ__) >> AHBPrescTable[((__AHBPRESCALER__) & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos])
709 * @brief Helper macro to calculate the PCLK1 frequency (ABP1)
710 * @note: __APB1PRESCALER__ be retrieved by @ref LL_RCC_GetAPB1Prescaler
711 * ex: __LL_RCC_CALC_PCLK1_FREQ(LL_RCC_GetAPB1Prescaler())
712 * @param __HCLKFREQ__ HCLK frequency
713 * @param __APB1PRESCALER__: This parameter can be one of the following values:
714 * @arg @ref LL_RCC_APB1_DIV_1
715 * @arg @ref LL_RCC_APB1_DIV_2
716 * @arg @ref LL_RCC_APB1_DIV_4
717 * @arg @ref LL_RCC_APB1_DIV_8
718 * @arg @ref LL_RCC_APB1_DIV_16
719 * @retval PCLK1 clock frequency (in Hz)
721 #define __LL_RCC_CALC_PCLK1_FREQ(__HCLKFREQ__, __APB1PRESCALER__) ((__HCLKFREQ__) >> APBPrescTable[(__APB1PRESCALER__) >> RCC_CFGR_PPRE1_Pos])
724 * @brief Helper macro to calculate the PCLK2 frequency (ABP2)
725 * @note: __APB2PRESCALER__ be retrieved by @ref LL_RCC_GetAPB2Prescaler
726 * ex: __LL_RCC_CALC_PCLK2_FREQ(LL_RCC_GetAPB2Prescaler())
727 * @param __HCLKFREQ__ HCLK frequency
728 * @param __APB2PRESCALER__: This parameter can be one of the following values:
729 * @arg @ref LL_RCC_APB2_DIV_1
730 * @arg @ref LL_RCC_APB2_DIV_2
731 * @arg @ref LL_RCC_APB2_DIV_4
732 * @arg @ref LL_RCC_APB2_DIV_8
733 * @arg @ref LL_RCC_APB2_DIV_16
734 * @retval PCLK2 clock frequency (in Hz)
736 #define __LL_RCC_CALC_PCLK2_FREQ(__HCLKFREQ__, __APB2PRESCALER__) ((__HCLKFREQ__) >> APBPrescTable[(__APB2PRESCALER__) >> RCC_CFGR_PPRE2_Pos])
746 /* Exported functions --------------------------------------------------------*/
747 /** @defgroup RCC_LL_Exported_Functions RCC Exported Functions
751 /** @defgroup RCC_LL_EF_HSE HSE
756 * @brief Enable the Clock Security System.
757 * @rmtoll CR CSSON LL_RCC_HSE_EnableCSS
760 __STATIC_INLINE
void LL_RCC_HSE_EnableCSS(void)
762 SET_BIT(RCC
->CR
, RCC_CR_CSSON
);
766 * @brief Enable HSE external oscillator (HSE Bypass)
767 * @rmtoll CR HSEBYP LL_RCC_HSE_EnableBypass
770 __STATIC_INLINE
void LL_RCC_HSE_EnableBypass(void)
772 SET_BIT(RCC
->CR
, RCC_CR_HSEBYP
);
776 * @brief Disable HSE external oscillator (HSE Bypass)
777 * @rmtoll CR HSEBYP LL_RCC_HSE_DisableBypass
780 __STATIC_INLINE
void LL_RCC_HSE_DisableBypass(void)
782 CLEAR_BIT(RCC
->CR
, RCC_CR_HSEBYP
);
786 * @brief Enable HSE crystal oscillator (HSE ON)
787 * @rmtoll CR HSEON LL_RCC_HSE_Enable
790 __STATIC_INLINE
void LL_RCC_HSE_Enable(void)
792 SET_BIT(RCC
->CR
, RCC_CR_HSEON
);
796 * @brief Disable HSE crystal oscillator (HSE ON)
797 * @rmtoll CR HSEON LL_RCC_HSE_Disable
800 __STATIC_INLINE
void LL_RCC_HSE_Disable(void)
802 CLEAR_BIT(RCC
->CR
, RCC_CR_HSEON
);
806 * @brief Check if HSE oscillator Ready
807 * @rmtoll CR HSERDY LL_RCC_HSE_IsReady
808 * @retval State of bit (1 or 0).
810 __STATIC_INLINE
uint32_t LL_RCC_HSE_IsReady(void)
812 return (READ_BIT(RCC
->CR
, RCC_CR_HSERDY
) == (RCC_CR_HSERDY
));
815 #if defined(RCC_CFGR2_PREDIV2)
817 * @brief Get PREDIV2 division factor
818 * @rmtoll CFGR2 PREDIV2 LL_RCC_HSE_GetPrediv2
819 * @retval Returned value can be one of the following values:
820 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_1
821 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_2
822 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_3
823 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_4
824 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_5
825 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_6
826 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_7
827 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_8
828 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_9
829 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_10
830 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_11
831 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_12
832 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_13
833 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_14
834 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_15
835 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_16
837 __STATIC_INLINE
uint32_t LL_RCC_HSE_GetPrediv2(void)
839 return (uint32_t)(READ_BIT(RCC
->CFGR2
, RCC_CFGR2_PREDIV2
));
841 #endif /* RCC_CFGR2_PREDIV2 */
847 /** @defgroup RCC_LL_EF_HSI HSI
852 * @brief Enable HSI oscillator
853 * @rmtoll CR HSION LL_RCC_HSI_Enable
856 __STATIC_INLINE
void LL_RCC_HSI_Enable(void)
858 SET_BIT(RCC
->CR
, RCC_CR_HSION
);
862 * @brief Disable HSI oscillator
863 * @rmtoll CR HSION LL_RCC_HSI_Disable
866 __STATIC_INLINE
void LL_RCC_HSI_Disable(void)
868 CLEAR_BIT(RCC
->CR
, RCC_CR_HSION
);
872 * @brief Check if HSI clock is ready
873 * @rmtoll CR HSIRDY LL_RCC_HSI_IsReady
874 * @retval State of bit (1 or 0).
876 __STATIC_INLINE
uint32_t LL_RCC_HSI_IsReady(void)
878 return (READ_BIT(RCC
->CR
, RCC_CR_HSIRDY
) == (RCC_CR_HSIRDY
));
882 * @brief Get HSI Calibration value
883 * @note When HSITRIM is written, HSICAL is updated with the sum of
884 * HSITRIM and the factory trim value
885 * @rmtoll CR HSICAL LL_RCC_HSI_GetCalibration
886 * @retval Between Min_Data = 0x00 and Max_Data = 0xFF
888 __STATIC_INLINE
uint32_t LL_RCC_HSI_GetCalibration(void)
890 return (uint32_t)(READ_BIT(RCC
->CR
, RCC_CR_HSICAL
) >> RCC_CR_HSICAL_Pos
);
894 * @brief Set HSI Calibration trimming
895 * @note user-programmable trimming value that is added to the HSICAL
896 * @note Default value is 16, which, when added to the HSICAL value,
897 * should trim the HSI to 16 MHz +/- 1 %
898 * @rmtoll CR HSITRIM LL_RCC_HSI_SetCalibTrimming
899 * @param Value between Min_Data = 0x00 and Max_Data = 0x1F
902 __STATIC_INLINE
void LL_RCC_HSI_SetCalibTrimming(uint32_t Value
)
904 MODIFY_REG(RCC
->CR
, RCC_CR_HSITRIM
, Value
<< RCC_CR_HSITRIM_Pos
);
908 * @brief Get HSI Calibration trimming
909 * @rmtoll CR HSITRIM LL_RCC_HSI_GetCalibTrimming
910 * @retval Between Min_Data = 0x00 and Max_Data = 0x1F
912 __STATIC_INLINE
uint32_t LL_RCC_HSI_GetCalibTrimming(void)
914 return (uint32_t)(READ_BIT(RCC
->CR
, RCC_CR_HSITRIM
) >> RCC_CR_HSITRIM_Pos
);
921 /** @defgroup RCC_LL_EF_LSE LSE
926 * @brief Enable Low Speed External (LSE) crystal.
927 * @rmtoll BDCR LSEON LL_RCC_LSE_Enable
930 __STATIC_INLINE
void LL_RCC_LSE_Enable(void)
932 SET_BIT(RCC
->BDCR
, RCC_BDCR_LSEON
);
936 * @brief Disable Low Speed External (LSE) crystal.
937 * @rmtoll BDCR LSEON LL_RCC_LSE_Disable
940 __STATIC_INLINE
void LL_RCC_LSE_Disable(void)
942 CLEAR_BIT(RCC
->BDCR
, RCC_BDCR_LSEON
);
946 * @brief Enable external clock source (LSE bypass).
947 * @rmtoll BDCR LSEBYP LL_RCC_LSE_EnableBypass
950 __STATIC_INLINE
void LL_RCC_LSE_EnableBypass(void)
952 SET_BIT(RCC
->BDCR
, RCC_BDCR_LSEBYP
);
956 * @brief Disable external clock source (LSE bypass).
957 * @rmtoll BDCR LSEBYP LL_RCC_LSE_DisableBypass
960 __STATIC_INLINE
void LL_RCC_LSE_DisableBypass(void)
962 CLEAR_BIT(RCC
->BDCR
, RCC_BDCR_LSEBYP
);
966 * @brief Check if LSE oscillator Ready
967 * @rmtoll BDCR LSERDY LL_RCC_LSE_IsReady
968 * @retval State of bit (1 or 0).
970 __STATIC_INLINE
uint32_t LL_RCC_LSE_IsReady(void)
972 return (READ_BIT(RCC
->BDCR
, RCC_BDCR_LSERDY
) == (RCC_BDCR_LSERDY
));
979 /** @defgroup RCC_LL_EF_LSI LSI
984 * @brief Enable LSI Oscillator
985 * @rmtoll CSR LSION LL_RCC_LSI_Enable
988 __STATIC_INLINE
void LL_RCC_LSI_Enable(void)
990 SET_BIT(RCC
->CSR
, RCC_CSR_LSION
);
994 * @brief Disable LSI Oscillator
995 * @rmtoll CSR LSION LL_RCC_LSI_Disable
998 __STATIC_INLINE
void LL_RCC_LSI_Disable(void)
1000 CLEAR_BIT(RCC
->CSR
, RCC_CSR_LSION
);
1004 * @brief Check if LSI is Ready
1005 * @rmtoll CSR LSIRDY LL_RCC_LSI_IsReady
1006 * @retval State of bit (1 or 0).
1008 __STATIC_INLINE
uint32_t LL_RCC_LSI_IsReady(void)
1010 return (READ_BIT(RCC
->CSR
, RCC_CSR_LSIRDY
) == (RCC_CSR_LSIRDY
));
1017 /** @defgroup RCC_LL_EF_System System
1022 * @brief Configure the system clock source
1023 * @rmtoll CFGR SW LL_RCC_SetSysClkSource
1024 * @param Source This parameter can be one of the following values:
1025 * @arg @ref LL_RCC_SYS_CLKSOURCE_HSI
1026 * @arg @ref LL_RCC_SYS_CLKSOURCE_HSE
1027 * @arg @ref LL_RCC_SYS_CLKSOURCE_PLL
1030 __STATIC_INLINE
void LL_RCC_SetSysClkSource(uint32_t Source
)
1032 MODIFY_REG(RCC
->CFGR
, RCC_CFGR_SW
, Source
);
1036 * @brief Get the system clock source
1037 * @rmtoll CFGR SWS LL_RCC_GetSysClkSource
1038 * @retval Returned value can be one of the following values:
1039 * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_HSI
1040 * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_HSE
1041 * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_PLL
1043 __STATIC_INLINE
uint32_t LL_RCC_GetSysClkSource(void)
1045 return (uint32_t)(READ_BIT(RCC
->CFGR
, RCC_CFGR_SWS
));
1049 * @brief Set AHB prescaler
1050 * @rmtoll CFGR HPRE LL_RCC_SetAHBPrescaler
1051 * @param Prescaler This parameter can be one of the following values:
1052 * @arg @ref LL_RCC_SYSCLK_DIV_1
1053 * @arg @ref LL_RCC_SYSCLK_DIV_2
1054 * @arg @ref LL_RCC_SYSCLK_DIV_4
1055 * @arg @ref LL_RCC_SYSCLK_DIV_8
1056 * @arg @ref LL_RCC_SYSCLK_DIV_16
1057 * @arg @ref LL_RCC_SYSCLK_DIV_64
1058 * @arg @ref LL_RCC_SYSCLK_DIV_128
1059 * @arg @ref LL_RCC_SYSCLK_DIV_256
1060 * @arg @ref LL_RCC_SYSCLK_DIV_512
1063 __STATIC_INLINE
void LL_RCC_SetAHBPrescaler(uint32_t Prescaler
)
1065 MODIFY_REG(RCC
->CFGR
, RCC_CFGR_HPRE
, Prescaler
);
1069 * @brief Set APB1 prescaler
1070 * @rmtoll CFGR PPRE1 LL_RCC_SetAPB1Prescaler
1071 * @param Prescaler This parameter can be one of the following values:
1072 * @arg @ref LL_RCC_APB1_DIV_1
1073 * @arg @ref LL_RCC_APB1_DIV_2
1074 * @arg @ref LL_RCC_APB1_DIV_4
1075 * @arg @ref LL_RCC_APB1_DIV_8
1076 * @arg @ref LL_RCC_APB1_DIV_16
1079 __STATIC_INLINE
void LL_RCC_SetAPB1Prescaler(uint32_t Prescaler
)
1081 MODIFY_REG(RCC
->CFGR
, RCC_CFGR_PPRE1
, Prescaler
);
1085 * @brief Set APB2 prescaler
1086 * @rmtoll CFGR PPRE2 LL_RCC_SetAPB2Prescaler
1087 * @param Prescaler This parameter can be one of the following values:
1088 * @arg @ref LL_RCC_APB2_DIV_1
1089 * @arg @ref LL_RCC_APB2_DIV_2
1090 * @arg @ref LL_RCC_APB2_DIV_4
1091 * @arg @ref LL_RCC_APB2_DIV_8
1092 * @arg @ref LL_RCC_APB2_DIV_16
1095 __STATIC_INLINE
void LL_RCC_SetAPB2Prescaler(uint32_t Prescaler
)
1097 MODIFY_REG(RCC
->CFGR
, RCC_CFGR_PPRE2
, Prescaler
);
1101 * @brief Get AHB prescaler
1102 * @rmtoll CFGR HPRE LL_RCC_GetAHBPrescaler
1103 * @retval Returned value can be one of the following values:
1104 * @arg @ref LL_RCC_SYSCLK_DIV_1
1105 * @arg @ref LL_RCC_SYSCLK_DIV_2
1106 * @arg @ref LL_RCC_SYSCLK_DIV_4
1107 * @arg @ref LL_RCC_SYSCLK_DIV_8
1108 * @arg @ref LL_RCC_SYSCLK_DIV_16
1109 * @arg @ref LL_RCC_SYSCLK_DIV_64
1110 * @arg @ref LL_RCC_SYSCLK_DIV_128
1111 * @arg @ref LL_RCC_SYSCLK_DIV_256
1112 * @arg @ref LL_RCC_SYSCLK_DIV_512
1114 __STATIC_INLINE
uint32_t LL_RCC_GetAHBPrescaler(void)
1116 return (uint32_t)(READ_BIT(RCC
->CFGR
, RCC_CFGR_HPRE
));
1120 * @brief Get APB1 prescaler
1121 * @rmtoll CFGR PPRE1 LL_RCC_GetAPB1Prescaler
1122 * @retval Returned value can be one of the following values:
1123 * @arg @ref LL_RCC_APB1_DIV_1
1124 * @arg @ref LL_RCC_APB1_DIV_2
1125 * @arg @ref LL_RCC_APB1_DIV_4
1126 * @arg @ref LL_RCC_APB1_DIV_8
1127 * @arg @ref LL_RCC_APB1_DIV_16
1129 __STATIC_INLINE
uint32_t LL_RCC_GetAPB1Prescaler(void)
1131 return (uint32_t)(READ_BIT(RCC
->CFGR
, RCC_CFGR_PPRE1
));
1135 * @brief Get APB2 prescaler
1136 * @rmtoll CFGR PPRE2 LL_RCC_GetAPB2Prescaler
1137 * @retval Returned value can be one of the following values:
1138 * @arg @ref LL_RCC_APB2_DIV_1
1139 * @arg @ref LL_RCC_APB2_DIV_2
1140 * @arg @ref LL_RCC_APB2_DIV_4
1141 * @arg @ref LL_RCC_APB2_DIV_8
1142 * @arg @ref LL_RCC_APB2_DIV_16
1144 __STATIC_INLINE
uint32_t LL_RCC_GetAPB2Prescaler(void)
1146 return (uint32_t)(READ_BIT(RCC
->CFGR
, RCC_CFGR_PPRE2
));
1153 /** @defgroup RCC_LL_EF_MCO MCO
1158 * @brief Configure MCOx
1159 * @rmtoll CFGR MCO LL_RCC_ConfigMCO
1160 * @param MCOxSource This parameter can be one of the following values:
1161 * @arg @ref LL_RCC_MCO1SOURCE_NOCLOCK
1162 * @arg @ref LL_RCC_MCO1SOURCE_SYSCLK
1163 * @arg @ref LL_RCC_MCO1SOURCE_HSI
1164 * @arg @ref LL_RCC_MCO1SOURCE_HSE
1165 * @arg @ref LL_RCC_MCO1SOURCE_PLLCLK_DIV_2
1166 * @arg @ref LL_RCC_MCO1SOURCE_PLL2CLK (*)
1167 * @arg @ref LL_RCC_MCO1SOURCE_PLLI2SCLK_DIV2 (*)
1168 * @arg @ref LL_RCC_MCO1SOURCE_EXT_HSE (*)
1169 * @arg @ref LL_RCC_MCO1SOURCE_PLLI2SCLK (*)
1171 * (*) value not defined in all devices
1174 __STATIC_INLINE
void LL_RCC_ConfigMCO(uint32_t MCOxSource
)
1176 MODIFY_REG(RCC
->CFGR
, RCC_CFGR_MCOSEL
, MCOxSource
);
1183 /** @defgroup RCC_LL_EF_Peripheral_Clock_Source Peripheral Clock Source
1187 #if defined(RCC_CFGR2_I2S2SRC)
1189 * @brief Configure I2Sx clock source
1190 * @rmtoll CFGR2 I2S2SRC LL_RCC_SetI2SClockSource\n
1191 * CFGR2 I2S3SRC LL_RCC_SetI2SClockSource
1192 * @param I2SxSource This parameter can be one of the following values:
1193 * @arg @ref LL_RCC_I2S2_CLKSOURCE_SYSCLK
1194 * @arg @ref LL_RCC_I2S2_CLKSOURCE_PLLI2S_VCO
1195 * @arg @ref LL_RCC_I2S3_CLKSOURCE_SYSCLK
1196 * @arg @ref LL_RCC_I2S3_CLKSOURCE_PLLI2S_VCO
1199 __STATIC_INLINE
void LL_RCC_SetI2SClockSource(uint32_t I2SxSource
)
1201 MODIFY_REG(RCC
->CFGR2
, (I2SxSource
& 0xFFFF0000U
), (I2SxSource
<< 16U));
1203 #endif /* RCC_CFGR2_I2S2SRC */
1205 #if defined(USB_OTG_FS) || defined(USB)
1207 * @brief Configure USB clock source
1208 * @rmtoll CFGR OTGFSPRE LL_RCC_SetUSBClockSource\n
1209 * CFGR USBPRE LL_RCC_SetUSBClockSource
1210 * @param USBxSource This parameter can be one of the following values:
1211 * @arg @ref LL_RCC_USB_CLKSOURCE_PLL (*)
1212 * @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5 (*)
1213 * @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_2 (*)
1214 * @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_3 (*)
1216 * (*) value not defined in all devices
1219 __STATIC_INLINE
void LL_RCC_SetUSBClockSource(uint32_t USBxSource
)
1221 #if defined(RCC_CFGR_USBPRE)
1222 MODIFY_REG(RCC
->CFGR
, RCC_CFGR_USBPRE
, USBxSource
);
1223 #else /*RCC_CFGR_OTGFSPRE*/
1224 MODIFY_REG(RCC
->CFGR
, RCC_CFGR_OTGFSPRE
, USBxSource
);
1225 #endif /*RCC_CFGR_USBPRE*/
1227 #endif /* USB_OTG_FS || USB */
1230 * @brief Configure ADC clock source
1231 * @rmtoll CFGR ADCPRE LL_RCC_SetADCClockSource
1232 * @param ADCxSource This parameter can be one of the following values:
1233 * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_2
1234 * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_4
1235 * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_6
1236 * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_8
1239 __STATIC_INLINE
void LL_RCC_SetADCClockSource(uint32_t ADCxSource
)
1241 MODIFY_REG(RCC
->CFGR
, RCC_CFGR_ADCPRE
, ADCxSource
);
1244 #if defined(RCC_CFGR2_I2S2SRC)
1246 * @brief Get I2Sx clock source
1247 * @rmtoll CFGR2 I2S2SRC LL_RCC_GetI2SClockSource\n
1248 * CFGR2 I2S3SRC LL_RCC_GetI2SClockSource
1249 * @param I2Sx This parameter can be one of the following values:
1250 * @arg @ref LL_RCC_I2S2_CLKSOURCE
1251 * @arg @ref LL_RCC_I2S3_CLKSOURCE
1252 * @retval Returned value can be one of the following values:
1253 * @arg @ref LL_RCC_I2S2_CLKSOURCE_SYSCLK
1254 * @arg @ref LL_RCC_I2S2_CLKSOURCE_PLLI2S_VCO
1255 * @arg @ref LL_RCC_I2S3_CLKSOURCE_SYSCLK
1256 * @arg @ref LL_RCC_I2S3_CLKSOURCE_PLLI2S_VCO
1258 __STATIC_INLINE
uint32_t LL_RCC_GetI2SClockSource(uint32_t I2Sx
)
1260 return (uint32_t)(READ_BIT(RCC
->CFGR2
, I2Sx
) >> 16U | I2Sx
);
1262 #endif /* RCC_CFGR2_I2S2SRC */
1264 #if defined(USB_OTG_FS) || defined(USB)
1266 * @brief Get USBx clock source
1267 * @rmtoll CFGR OTGFSPRE LL_RCC_GetUSBClockSource\n
1268 * CFGR USBPRE LL_RCC_GetUSBClockSource
1269 * @param USBx This parameter can be one of the following values:
1270 * @arg @ref LL_RCC_USB_CLKSOURCE
1271 * @retval Returned value can be one of the following values:
1272 * @arg @ref LL_RCC_USB_CLKSOURCE_PLL (*)
1273 * @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5 (*)
1274 * @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_2 (*)
1275 * @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_3 (*)
1277 * (*) value not defined in all devices
1279 __STATIC_INLINE
uint32_t LL_RCC_GetUSBClockSource(uint32_t USBx
)
1281 return (uint32_t)(READ_BIT(RCC
->CFGR
, USBx
));
1283 #endif /* USB_OTG_FS || USB */
1286 * @brief Get ADCx clock source
1287 * @rmtoll CFGR ADCPRE LL_RCC_GetADCClockSource
1288 * @param ADCx This parameter can be one of the following values:
1289 * @arg @ref LL_RCC_ADC_CLKSOURCE
1290 * @retval Returned value can be one of the following values:
1291 * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_2
1292 * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_4
1293 * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_6
1294 * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_8
1296 __STATIC_INLINE
uint32_t LL_RCC_GetADCClockSource(uint32_t ADCx
)
1298 return (uint32_t)(READ_BIT(RCC
->CFGR
, ADCx
));
1305 /** @defgroup RCC_LL_EF_RTC RTC
1310 * @brief Set RTC Clock Source
1311 * @note Once the RTC clock source has been selected, it cannot be changed any more unless
1312 * the Backup domain is reset. The BDRST bit can be used to reset them.
1313 * @rmtoll BDCR RTCSEL LL_RCC_SetRTCClockSource
1314 * @param Source This parameter can be one of the following values:
1315 * @arg @ref LL_RCC_RTC_CLKSOURCE_NONE
1316 * @arg @ref LL_RCC_RTC_CLKSOURCE_LSE
1317 * @arg @ref LL_RCC_RTC_CLKSOURCE_LSI
1318 * @arg @ref LL_RCC_RTC_CLKSOURCE_HSE_DIV128
1321 __STATIC_INLINE
void LL_RCC_SetRTCClockSource(uint32_t Source
)
1323 MODIFY_REG(RCC
->BDCR
, RCC_BDCR_RTCSEL
, Source
);
1327 * @brief Get RTC Clock Source
1328 * @rmtoll BDCR RTCSEL LL_RCC_GetRTCClockSource
1329 * @retval Returned value can be one of the following values:
1330 * @arg @ref LL_RCC_RTC_CLKSOURCE_NONE
1331 * @arg @ref LL_RCC_RTC_CLKSOURCE_LSE
1332 * @arg @ref LL_RCC_RTC_CLKSOURCE_LSI
1333 * @arg @ref LL_RCC_RTC_CLKSOURCE_HSE_DIV128
1335 __STATIC_INLINE
uint32_t LL_RCC_GetRTCClockSource(void)
1337 return (uint32_t)(READ_BIT(RCC
->BDCR
, RCC_BDCR_RTCSEL
));
1342 * @rmtoll BDCR RTCEN LL_RCC_EnableRTC
1345 __STATIC_INLINE
void LL_RCC_EnableRTC(void)
1347 SET_BIT(RCC
->BDCR
, RCC_BDCR_RTCEN
);
1351 * @brief Disable RTC
1352 * @rmtoll BDCR RTCEN LL_RCC_DisableRTC
1355 __STATIC_INLINE
void LL_RCC_DisableRTC(void)
1357 CLEAR_BIT(RCC
->BDCR
, RCC_BDCR_RTCEN
);
1361 * @brief Check if RTC has been enabled or not
1362 * @rmtoll BDCR RTCEN LL_RCC_IsEnabledRTC
1363 * @retval State of bit (1 or 0).
1365 __STATIC_INLINE
uint32_t LL_RCC_IsEnabledRTC(void)
1367 return (READ_BIT(RCC
->BDCR
, RCC_BDCR_RTCEN
) == (RCC_BDCR_RTCEN
));
1371 * @brief Force the Backup domain reset
1372 * @rmtoll BDCR BDRST LL_RCC_ForceBackupDomainReset
1375 __STATIC_INLINE
void LL_RCC_ForceBackupDomainReset(void)
1377 SET_BIT(RCC
->BDCR
, RCC_BDCR_BDRST
);
1381 * @brief Release the Backup domain reset
1382 * @rmtoll BDCR BDRST LL_RCC_ReleaseBackupDomainReset
1385 __STATIC_INLINE
void LL_RCC_ReleaseBackupDomainReset(void)
1387 CLEAR_BIT(RCC
->BDCR
, RCC_BDCR_BDRST
);
1394 /** @defgroup RCC_LL_EF_PLL PLL
1400 * @rmtoll CR PLLON LL_RCC_PLL_Enable
1403 __STATIC_INLINE
void LL_RCC_PLL_Enable(void)
1405 SET_BIT(RCC
->CR
, RCC_CR_PLLON
);
1409 * @brief Disable PLL
1410 * @note Cannot be disabled if the PLL clock is used as the system clock
1411 * @rmtoll CR PLLON LL_RCC_PLL_Disable
1414 __STATIC_INLINE
void LL_RCC_PLL_Disable(void)
1416 CLEAR_BIT(RCC
->CR
, RCC_CR_PLLON
);
1420 * @brief Check if PLL Ready
1421 * @rmtoll CR PLLRDY LL_RCC_PLL_IsReady
1422 * @retval State of bit (1 or 0).
1424 __STATIC_INLINE
uint32_t LL_RCC_PLL_IsReady(void)
1426 return (READ_BIT(RCC
->CR
, RCC_CR_PLLRDY
) == (RCC_CR_PLLRDY
));
1430 * @brief Configure PLL used for SYSCLK Domain
1431 * @rmtoll CFGR PLLSRC LL_RCC_PLL_ConfigDomain_SYS\n
1432 * CFGR PLLXTPRE LL_RCC_PLL_ConfigDomain_SYS\n
1433 * CFGR PLLMULL LL_RCC_PLL_ConfigDomain_SYS\n
1434 * CFGR2 PREDIV1 LL_RCC_PLL_ConfigDomain_SYS\n
1435 * CFGR2 PREDIV1SRC LL_RCC_PLL_ConfigDomain_SYS
1436 * @param Source This parameter can be one of the following values:
1437 * @arg @ref LL_RCC_PLLSOURCE_HSI_DIV_2
1438 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_1
1439 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_2 (*)
1440 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_3 (*)
1441 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_4 (*)
1442 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_5 (*)
1443 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_6 (*)
1444 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_7 (*)
1445 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_8 (*)
1446 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_9 (*)
1447 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_10 (*)
1448 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_11 (*)
1449 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_12 (*)
1450 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_13 (*)
1451 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_14 (*)
1452 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_15 (*)
1453 * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_16 (*)
1454 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_2 (*)
1455 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_3 (*)
1456 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_4 (*)
1457 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_5 (*)
1458 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_6 (*)
1459 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_7 (*)
1460 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_8 (*)
1461 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_9 (*)
1462 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_10 (*)
1463 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_11 (*)
1464 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_12 (*)
1465 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_13 (*)
1466 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_14 (*)
1467 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_15 (*)
1468 * @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_16 (*)
1470 * (*) value not defined in all devices
1471 * @param PLLMul This parameter can be one of the following values:
1472 * @arg @ref LL_RCC_PLL_MUL_2 (*)
1473 * @arg @ref LL_RCC_PLL_MUL_3 (*)
1474 * @arg @ref LL_RCC_PLL_MUL_4
1475 * @arg @ref LL_RCC_PLL_MUL_5
1476 * @arg @ref LL_RCC_PLL_MUL_6
1477 * @arg @ref LL_RCC_PLL_MUL_7
1478 * @arg @ref LL_RCC_PLL_MUL_8
1479 * @arg @ref LL_RCC_PLL_MUL_9
1480 * @arg @ref LL_RCC_PLL_MUL_6_5 (*)
1481 * @arg @ref LL_RCC_PLL_MUL_10 (*)
1482 * @arg @ref LL_RCC_PLL_MUL_11 (*)
1483 * @arg @ref LL_RCC_PLL_MUL_12 (*)
1484 * @arg @ref LL_RCC_PLL_MUL_13 (*)
1485 * @arg @ref LL_RCC_PLL_MUL_14 (*)
1486 * @arg @ref LL_RCC_PLL_MUL_15 (*)
1487 * @arg @ref LL_RCC_PLL_MUL_16 (*)
1489 * (*) value not defined in all devices
1492 __STATIC_INLINE
void LL_RCC_PLL_ConfigDomain_SYS(uint32_t Source
, uint32_t PLLMul
)
1494 MODIFY_REG(RCC
->CFGR
, RCC_CFGR_PLLSRC
| RCC_CFGR_PLLXTPRE
| RCC_CFGR_PLLMULL
,
1495 (Source
& (RCC_CFGR_PLLSRC
| RCC_CFGR_PLLXTPRE
)) | PLLMul
);
1496 #if defined(RCC_CFGR2_PREDIV1)
1497 #if defined(RCC_CFGR2_PREDIV1SRC)
1498 MODIFY_REG(RCC
->CFGR2
, (RCC_CFGR2_PREDIV1
| RCC_CFGR2_PREDIV1SRC
),
1499 (Source
& RCC_CFGR2_PREDIV1
) | ((Source
& (RCC_CFGR2_PREDIV1SRC
<< 4U)) >> 4U));
1501 MODIFY_REG(RCC
->CFGR2
, RCC_CFGR2_PREDIV1
, (Source
& RCC_CFGR2_PREDIV1
));
1502 #endif /*RCC_CFGR2_PREDIV1SRC*/
1503 #endif /*RCC_CFGR2_PREDIV1*/
1507 * @brief Get the oscillator used as PLL clock source.
1508 * @rmtoll CFGR PLLSRC LL_RCC_PLL_GetMainSource\n
1509 * CFGR2 PREDIV1SRC LL_RCC_PLL_GetMainSource
1510 * @retval Returned value can be one of the following values:
1511 * @arg @ref LL_RCC_PLLSOURCE_HSI_DIV_2
1512 * @arg @ref LL_RCC_PLLSOURCE_HSE
1513 * @arg @ref LL_RCC_PLLSOURCE_PLL2 (*)
1515 * (*) value not defined in all devices
1517 __STATIC_INLINE
uint32_t LL_RCC_PLL_GetMainSource(void)
1519 #if defined(RCC_CFGR2_PREDIV1SRC)
1520 register uint32_t pllsrc
= READ_BIT(RCC
->CFGR
, RCC_CFGR_PLLSRC
);
1521 register uint32_t predivsrc
= (uint32_t)(READ_BIT(RCC
->CFGR2
, RCC_CFGR2_PREDIV1SRC
) << 4U);
1522 return (uint32_t)(pllsrc
| predivsrc
);
1524 return (uint32_t)(READ_BIT(RCC
->CFGR
, RCC_CFGR_PLLSRC
));
1525 #endif /*RCC_CFGR2_PREDIV1SRC*/
1529 * @brief Get PLL multiplication Factor
1530 * @rmtoll CFGR PLLMULL LL_RCC_PLL_GetMultiplicator
1531 * @retval Returned value can be one of the following values:
1532 * @arg @ref LL_RCC_PLL_MUL_2 (*)
1533 * @arg @ref LL_RCC_PLL_MUL_3 (*)
1534 * @arg @ref LL_RCC_PLL_MUL_4
1535 * @arg @ref LL_RCC_PLL_MUL_5
1536 * @arg @ref LL_RCC_PLL_MUL_6
1537 * @arg @ref LL_RCC_PLL_MUL_7
1538 * @arg @ref LL_RCC_PLL_MUL_8
1539 * @arg @ref LL_RCC_PLL_MUL_9
1540 * @arg @ref LL_RCC_PLL_MUL_6_5 (*)
1541 * @arg @ref LL_RCC_PLL_MUL_10 (*)
1542 * @arg @ref LL_RCC_PLL_MUL_11 (*)
1543 * @arg @ref LL_RCC_PLL_MUL_12 (*)
1544 * @arg @ref LL_RCC_PLL_MUL_13 (*)
1545 * @arg @ref LL_RCC_PLL_MUL_14 (*)
1546 * @arg @ref LL_RCC_PLL_MUL_15 (*)
1547 * @arg @ref LL_RCC_PLL_MUL_16 (*)
1549 * (*) value not defined in all devices
1551 __STATIC_INLINE
uint32_t LL_RCC_PLL_GetMultiplicator(void)
1553 return (uint32_t)(READ_BIT(RCC
->CFGR
, RCC_CFGR_PLLMULL
));
1557 * @brief Get PREDIV1 division factor for the main PLL
1558 * @note They can be written only when the PLL is disabled
1559 * @rmtoll CFGR2 PREDIV1 LL_RCC_PLL_GetPrediv\n
1560 * CFGR2 PLLXTPRE LL_RCC_PLL_GetPrediv
1561 * @retval Returned value can be one of the following values:
1562 * @arg @ref LL_RCC_PREDIV_DIV_1
1563 * @arg @ref LL_RCC_PREDIV_DIV_2
1564 * @arg @ref LL_RCC_PREDIV_DIV_3 (*)
1565 * @arg @ref LL_RCC_PREDIV_DIV_4 (*)
1566 * @arg @ref LL_RCC_PREDIV_DIV_5 (*)
1567 * @arg @ref LL_RCC_PREDIV_DIV_6 (*)
1568 * @arg @ref LL_RCC_PREDIV_DIV_7 (*)
1569 * @arg @ref LL_RCC_PREDIV_DIV_8 (*)
1570 * @arg @ref LL_RCC_PREDIV_DIV_9 (*)
1571 * @arg @ref LL_RCC_PREDIV_DIV_10 (*)
1572 * @arg @ref LL_RCC_PREDIV_DIV_11 (*)
1573 * @arg @ref LL_RCC_PREDIV_DIV_12 (*)
1574 * @arg @ref LL_RCC_PREDIV_DIV_13 (*)
1575 * @arg @ref LL_RCC_PREDIV_DIV_14 (*)
1576 * @arg @ref LL_RCC_PREDIV_DIV_15 (*)
1577 * @arg @ref LL_RCC_PREDIV_DIV_16 (*)
1579 * (*) value not defined in all devices
1581 __STATIC_INLINE
uint32_t LL_RCC_PLL_GetPrediv(void)
1583 #if defined(RCC_CFGR2_PREDIV1)
1584 return (uint32_t)(READ_BIT(RCC
->CFGR2
, RCC_CFGR2_PREDIV1
));
1586 return (uint32_t)(READ_BIT(RCC
->CFGR
, RCC_CFGR_PLLXTPRE
));
1587 #endif /*RCC_CFGR2_PREDIV1*/
1594 #if defined(RCC_PLLI2S_SUPPORT)
1595 /** @defgroup RCC_LL_EF_PLLI2S PLLI2S
1600 * @brief Enable PLLI2S
1601 * @rmtoll CR PLL3ON LL_RCC_PLLI2S_Enable
1604 __STATIC_INLINE
void LL_RCC_PLLI2S_Enable(void)
1606 SET_BIT(RCC
->CR
, RCC_CR_PLL3ON
);
1610 * @brief Disable PLLI2S
1611 * @rmtoll CR PLL3ON LL_RCC_PLLI2S_Disable
1614 __STATIC_INLINE
void LL_RCC_PLLI2S_Disable(void)
1616 CLEAR_BIT(RCC
->CR
, RCC_CR_PLL3ON
);
1620 * @brief Check if PLLI2S Ready
1621 * @rmtoll CR PLL3RDY LL_RCC_PLLI2S_IsReady
1622 * @retval State of bit (1 or 0).
1624 __STATIC_INLINE
uint32_t LL_RCC_PLLI2S_IsReady(void)
1626 return (READ_BIT(RCC
->CR
, RCC_CR_PLL3RDY
) == (RCC_CR_PLL3RDY
));
1630 * @brief Configure PLLI2S used for I2S Domain
1631 * @rmtoll CFGR2 PREDIV2 LL_RCC_PLL_ConfigDomain_PLLI2S\n
1632 * CFGR2 PLL3MUL LL_RCC_PLL_ConfigDomain_PLLI2S
1633 * @param Divider This parameter can be one of the following values:
1634 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_1
1635 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_2
1636 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_3
1637 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_4
1638 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_5
1639 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_6
1640 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_7
1641 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_8
1642 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_9
1643 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_10
1644 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_11
1645 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_12
1646 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_13
1647 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_14
1648 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_15
1649 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_16
1650 * @param Multiplicator This parameter can be one of the following values:
1651 * @arg @ref LL_RCC_PLLI2S_MUL_8
1652 * @arg @ref LL_RCC_PLLI2S_MUL_9
1653 * @arg @ref LL_RCC_PLLI2S_MUL_10
1654 * @arg @ref LL_RCC_PLLI2S_MUL_11
1655 * @arg @ref LL_RCC_PLLI2S_MUL_12
1656 * @arg @ref LL_RCC_PLLI2S_MUL_13
1657 * @arg @ref LL_RCC_PLLI2S_MUL_14
1658 * @arg @ref LL_RCC_PLLI2S_MUL_16
1659 * @arg @ref LL_RCC_PLLI2S_MUL_20
1662 __STATIC_INLINE
void LL_RCC_PLL_ConfigDomain_PLLI2S(uint32_t Divider
, uint32_t Multiplicator
)
1664 MODIFY_REG(RCC
->CFGR2
, RCC_CFGR2_PREDIV2
| RCC_CFGR2_PLL3MUL
, Divider
| Multiplicator
);
1668 * @brief Get PLLI2S Multiplication Factor
1669 * @rmtoll CFGR2 PLL3MUL LL_RCC_PLLI2S_GetMultiplicator
1670 * @retval Returned value can be one of the following values:
1671 * @arg @ref LL_RCC_PLLI2S_MUL_8
1672 * @arg @ref LL_RCC_PLLI2S_MUL_9
1673 * @arg @ref LL_RCC_PLLI2S_MUL_10
1674 * @arg @ref LL_RCC_PLLI2S_MUL_11
1675 * @arg @ref LL_RCC_PLLI2S_MUL_12
1676 * @arg @ref LL_RCC_PLLI2S_MUL_13
1677 * @arg @ref LL_RCC_PLLI2S_MUL_14
1678 * @arg @ref LL_RCC_PLLI2S_MUL_16
1679 * @arg @ref LL_RCC_PLLI2S_MUL_20
1681 __STATIC_INLINE
uint32_t LL_RCC_PLLI2S_GetMultiplicator(void)
1683 return (uint32_t)(READ_BIT(RCC
->CFGR2
, RCC_CFGR2_PLL3MUL
));
1689 #endif /* RCC_PLLI2S_SUPPORT */
1691 #if defined(RCC_PLL2_SUPPORT)
1692 /** @defgroup RCC_LL_EF_PLL2 PLL2
1697 * @brief Enable PLL2
1698 * @rmtoll CR PLL2ON LL_RCC_PLL2_Enable
1701 __STATIC_INLINE
void LL_RCC_PLL2_Enable(void)
1703 SET_BIT(RCC
->CR
, RCC_CR_PLL2ON
);
1707 * @brief Disable PLL2
1708 * @rmtoll CR PLL2ON LL_RCC_PLL2_Disable
1711 __STATIC_INLINE
void LL_RCC_PLL2_Disable(void)
1713 CLEAR_BIT(RCC
->CR
, RCC_CR_PLL2ON
);
1717 * @brief Check if PLL2 Ready
1718 * @rmtoll CR PLL2RDY LL_RCC_PLL2_IsReady
1719 * @retval State of bit (1 or 0).
1721 __STATIC_INLINE
uint32_t LL_RCC_PLL2_IsReady(void)
1723 return (READ_BIT(RCC
->CR
, RCC_CR_PLL2RDY
) == (RCC_CR_PLL2RDY
));
1727 * @brief Configure PLL2 used for PLL2 Domain
1728 * @rmtoll CFGR2 PREDIV2 LL_RCC_PLL_ConfigDomain_PLL2\n
1729 * CFGR2 PLL2MUL LL_RCC_PLL_ConfigDomain_PLL2
1730 * @param Divider This parameter can be one of the following values:
1731 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_1
1732 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_2
1733 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_3
1734 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_4
1735 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_5
1736 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_6
1737 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_7
1738 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_8
1739 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_9
1740 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_10
1741 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_11
1742 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_12
1743 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_13
1744 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_14
1745 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_15
1746 * @arg @ref LL_RCC_HSE_PREDIV2_DIV_16
1747 * @param Multiplicator This parameter can be one of the following values:
1748 * @arg @ref LL_RCC_PLL2_MUL_8
1749 * @arg @ref LL_RCC_PLL2_MUL_9
1750 * @arg @ref LL_RCC_PLL2_MUL_10
1751 * @arg @ref LL_RCC_PLL2_MUL_11
1752 * @arg @ref LL_RCC_PLL2_MUL_12
1753 * @arg @ref LL_RCC_PLL2_MUL_13
1754 * @arg @ref LL_RCC_PLL2_MUL_14
1755 * @arg @ref LL_RCC_PLL2_MUL_16
1756 * @arg @ref LL_RCC_PLL2_MUL_20
1759 __STATIC_INLINE
void LL_RCC_PLL_ConfigDomain_PLL2(uint32_t Divider
, uint32_t Multiplicator
)
1761 MODIFY_REG(RCC
->CFGR2
, RCC_CFGR2_PREDIV2
| RCC_CFGR2_PLL2MUL
, Divider
| Multiplicator
);
1765 * @brief Get PLL2 Multiplication Factor
1766 * @rmtoll CFGR2 PLL2MUL LL_RCC_PLL2_GetMultiplicator
1767 * @retval Returned value can be one of the following values:
1768 * @arg @ref LL_RCC_PLL2_MUL_8
1769 * @arg @ref LL_RCC_PLL2_MUL_9
1770 * @arg @ref LL_RCC_PLL2_MUL_10
1771 * @arg @ref LL_RCC_PLL2_MUL_11
1772 * @arg @ref LL_RCC_PLL2_MUL_12
1773 * @arg @ref LL_RCC_PLL2_MUL_13
1774 * @arg @ref LL_RCC_PLL2_MUL_14
1775 * @arg @ref LL_RCC_PLL2_MUL_16
1776 * @arg @ref LL_RCC_PLL2_MUL_20
1778 __STATIC_INLINE
uint32_t LL_RCC_PLL2_GetMultiplicator(void)
1780 return (uint32_t)(READ_BIT(RCC
->CFGR2
, RCC_CFGR2_PLL2MUL
));
1786 #endif /* RCC_PLL2_SUPPORT */
1788 /** @defgroup RCC_LL_EF_FLAG_Management FLAG Management
1793 * @brief Clear LSI ready interrupt flag
1794 * @rmtoll CIR LSIRDYC LL_RCC_ClearFlag_LSIRDY
1797 __STATIC_INLINE
void LL_RCC_ClearFlag_LSIRDY(void)
1799 SET_BIT(RCC
->CIR
, RCC_CIR_LSIRDYC
);
1803 * @brief Clear LSE ready interrupt flag
1804 * @rmtoll CIR LSERDYC LL_RCC_ClearFlag_LSERDY
1807 __STATIC_INLINE
void LL_RCC_ClearFlag_LSERDY(void)
1809 SET_BIT(RCC
->CIR
, RCC_CIR_LSERDYC
);
1813 * @brief Clear HSI ready interrupt flag
1814 * @rmtoll CIR HSIRDYC LL_RCC_ClearFlag_HSIRDY
1817 __STATIC_INLINE
void LL_RCC_ClearFlag_HSIRDY(void)
1819 SET_BIT(RCC
->CIR
, RCC_CIR_HSIRDYC
);
1823 * @brief Clear HSE ready interrupt flag
1824 * @rmtoll CIR HSERDYC LL_RCC_ClearFlag_HSERDY
1827 __STATIC_INLINE
void LL_RCC_ClearFlag_HSERDY(void)
1829 SET_BIT(RCC
->CIR
, RCC_CIR_HSERDYC
);
1833 * @brief Clear PLL ready interrupt flag
1834 * @rmtoll CIR PLLRDYC LL_RCC_ClearFlag_PLLRDY
1837 __STATIC_INLINE
void LL_RCC_ClearFlag_PLLRDY(void)
1839 SET_BIT(RCC
->CIR
, RCC_CIR_PLLRDYC
);
1842 #if defined(RCC_PLLI2S_SUPPORT)
1844 * @brief Clear PLLI2S ready interrupt flag
1845 * @rmtoll CIR PLL3RDYC LL_RCC_ClearFlag_PLLI2SRDY
1848 __STATIC_INLINE
void LL_RCC_ClearFlag_PLLI2SRDY(void)
1850 SET_BIT(RCC
->CIR
, RCC_CIR_PLL3RDYC
);
1852 #endif /* RCC_PLLI2S_SUPPORT */
1854 #if defined(RCC_PLL2_SUPPORT)
1856 * @brief Clear PLL2 ready interrupt flag
1857 * @rmtoll CIR PLL2RDYC LL_RCC_ClearFlag_PLL2RDY
1860 __STATIC_INLINE
void LL_RCC_ClearFlag_PLL2RDY(void)
1862 SET_BIT(RCC
->CIR
, RCC_CIR_PLL2RDYC
);
1864 #endif /* RCC_PLL2_SUPPORT */
1867 * @brief Clear Clock security system interrupt flag
1868 * @rmtoll CIR CSSC LL_RCC_ClearFlag_HSECSS
1871 __STATIC_INLINE
void LL_RCC_ClearFlag_HSECSS(void)
1873 SET_BIT(RCC
->CIR
, RCC_CIR_CSSC
);
1877 * @brief Check if LSI ready interrupt occurred or not
1878 * @rmtoll CIR LSIRDYF LL_RCC_IsActiveFlag_LSIRDY
1879 * @retval State of bit (1 or 0).
1881 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_LSIRDY(void)
1883 return (READ_BIT(RCC
->CIR
, RCC_CIR_LSIRDYF
) == (RCC_CIR_LSIRDYF
));
1887 * @brief Check if LSE ready interrupt occurred or not
1888 * @rmtoll CIR LSERDYF LL_RCC_IsActiveFlag_LSERDY
1889 * @retval State of bit (1 or 0).
1891 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_LSERDY(void)
1893 return (READ_BIT(RCC
->CIR
, RCC_CIR_LSERDYF
) == (RCC_CIR_LSERDYF
));
1897 * @brief Check if HSI ready interrupt occurred or not
1898 * @rmtoll CIR HSIRDYF LL_RCC_IsActiveFlag_HSIRDY
1899 * @retval State of bit (1 or 0).
1901 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_HSIRDY(void)
1903 return (READ_BIT(RCC
->CIR
, RCC_CIR_HSIRDYF
) == (RCC_CIR_HSIRDYF
));
1907 * @brief Check if HSE ready interrupt occurred or not
1908 * @rmtoll CIR HSERDYF LL_RCC_IsActiveFlag_HSERDY
1909 * @retval State of bit (1 or 0).
1911 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_HSERDY(void)
1913 return (READ_BIT(RCC
->CIR
, RCC_CIR_HSERDYF
) == (RCC_CIR_HSERDYF
));
1917 * @brief Check if PLL ready interrupt occurred or not
1918 * @rmtoll CIR PLLRDYF LL_RCC_IsActiveFlag_PLLRDY
1919 * @retval State of bit (1 or 0).
1921 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_PLLRDY(void)
1923 return (READ_BIT(RCC
->CIR
, RCC_CIR_PLLRDYF
) == (RCC_CIR_PLLRDYF
));
1926 #if defined(RCC_PLLI2S_SUPPORT)
1928 * @brief Check if PLLI2S ready interrupt occurred or not
1929 * @rmtoll CIR PLL3RDYF LL_RCC_IsActiveFlag_PLLI2SRDY
1930 * @retval State of bit (1 or 0).
1932 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_PLLI2SRDY(void)
1934 return (READ_BIT(RCC
->CIR
, RCC_CIR_PLL3RDYF
) == (RCC_CIR_PLL3RDYF
));
1936 #endif /* RCC_PLLI2S_SUPPORT */
1938 #if defined(RCC_PLL2_SUPPORT)
1940 * @brief Check if PLL2 ready interrupt occurred or not
1941 * @rmtoll CIR PLL2RDYF LL_RCC_IsActiveFlag_PLL2RDY
1942 * @retval State of bit (1 or 0).
1944 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_PLL2RDY(void)
1946 return (READ_BIT(RCC
->CIR
, RCC_CIR_PLL2RDYF
) == (RCC_CIR_PLL2RDYF
));
1948 #endif /* RCC_PLL2_SUPPORT */
1951 * @brief Check if Clock security system interrupt occurred or not
1952 * @rmtoll CIR CSSF LL_RCC_IsActiveFlag_HSECSS
1953 * @retval State of bit (1 or 0).
1955 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_HSECSS(void)
1957 return (READ_BIT(RCC
->CIR
, RCC_CIR_CSSF
) == (RCC_CIR_CSSF
));
1961 * @brief Check if RCC flag Independent Watchdog reset is set or not.
1962 * @rmtoll CSR IWDGRSTF LL_RCC_IsActiveFlag_IWDGRST
1963 * @retval State of bit (1 or 0).
1965 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_IWDGRST(void)
1967 return (READ_BIT(RCC
->CSR
, RCC_CSR_IWDGRSTF
) == (RCC_CSR_IWDGRSTF
));
1971 * @brief Check if RCC flag Low Power reset is set or not.
1972 * @rmtoll CSR LPWRRSTF LL_RCC_IsActiveFlag_LPWRRST
1973 * @retval State of bit (1 or 0).
1975 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_LPWRRST(void)
1977 return (READ_BIT(RCC
->CSR
, RCC_CSR_LPWRRSTF
) == (RCC_CSR_LPWRRSTF
));
1981 * @brief Check if RCC flag Pin reset is set or not.
1982 * @rmtoll CSR PINRSTF LL_RCC_IsActiveFlag_PINRST
1983 * @retval State of bit (1 or 0).
1985 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_PINRST(void)
1987 return (READ_BIT(RCC
->CSR
, RCC_CSR_PINRSTF
) == (RCC_CSR_PINRSTF
));
1991 * @brief Check if RCC flag POR/PDR reset is set or not.
1992 * @rmtoll CSR PORRSTF LL_RCC_IsActiveFlag_PORRST
1993 * @retval State of bit (1 or 0).
1995 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_PORRST(void)
1997 return (READ_BIT(RCC
->CSR
, RCC_CSR_PORRSTF
) == (RCC_CSR_PORRSTF
));
2001 * @brief Check if RCC flag Software reset is set or not.
2002 * @rmtoll CSR SFTRSTF LL_RCC_IsActiveFlag_SFTRST
2003 * @retval State of bit (1 or 0).
2005 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_SFTRST(void)
2007 return (READ_BIT(RCC
->CSR
, RCC_CSR_SFTRSTF
) == (RCC_CSR_SFTRSTF
));
2011 * @brief Check if RCC flag Window Watchdog reset is set or not.
2012 * @rmtoll CSR WWDGRSTF LL_RCC_IsActiveFlag_WWDGRST
2013 * @retval State of bit (1 or 0).
2015 __STATIC_INLINE
uint32_t LL_RCC_IsActiveFlag_WWDGRST(void)
2017 return (READ_BIT(RCC
->CSR
, RCC_CSR_WWDGRSTF
) == (RCC_CSR_WWDGRSTF
));
2021 * @brief Set RMVF bit to clear the reset flags.
2022 * @rmtoll CSR RMVF LL_RCC_ClearResetFlags
2025 __STATIC_INLINE
void LL_RCC_ClearResetFlags(void)
2027 SET_BIT(RCC
->CSR
, RCC_CSR_RMVF
);
2034 /** @defgroup RCC_LL_EF_IT_Management IT Management
2039 * @brief Enable LSI ready interrupt
2040 * @rmtoll CIR LSIRDYIE LL_RCC_EnableIT_LSIRDY
2043 __STATIC_INLINE
void LL_RCC_EnableIT_LSIRDY(void)
2045 SET_BIT(RCC
->CIR
, RCC_CIR_LSIRDYIE
);
2049 * @brief Enable LSE ready interrupt
2050 * @rmtoll CIR LSERDYIE LL_RCC_EnableIT_LSERDY
2053 __STATIC_INLINE
void LL_RCC_EnableIT_LSERDY(void)
2055 SET_BIT(RCC
->CIR
, RCC_CIR_LSERDYIE
);
2059 * @brief Enable HSI ready interrupt
2060 * @rmtoll CIR HSIRDYIE LL_RCC_EnableIT_HSIRDY
2063 __STATIC_INLINE
void LL_RCC_EnableIT_HSIRDY(void)
2065 SET_BIT(RCC
->CIR
, RCC_CIR_HSIRDYIE
);
2069 * @brief Enable HSE ready interrupt
2070 * @rmtoll CIR HSERDYIE LL_RCC_EnableIT_HSERDY
2073 __STATIC_INLINE
void LL_RCC_EnableIT_HSERDY(void)
2075 SET_BIT(RCC
->CIR
, RCC_CIR_HSERDYIE
);
2079 * @brief Enable PLL ready interrupt
2080 * @rmtoll CIR PLLRDYIE LL_RCC_EnableIT_PLLRDY
2083 __STATIC_INLINE
void LL_RCC_EnableIT_PLLRDY(void)
2085 SET_BIT(RCC
->CIR
, RCC_CIR_PLLRDYIE
);
2088 #if defined(RCC_PLLI2S_SUPPORT)
2090 * @brief Enable PLLI2S ready interrupt
2091 * @rmtoll CIR PLL3RDYIE LL_RCC_EnableIT_PLLI2SRDY
2094 __STATIC_INLINE
void LL_RCC_EnableIT_PLLI2SRDY(void)
2096 SET_BIT(RCC
->CIR
, RCC_CIR_PLL3RDYIE
);
2098 #endif /* RCC_PLLI2S_SUPPORT */
2100 #if defined(RCC_PLL2_SUPPORT)
2102 * @brief Enable PLL2 ready interrupt
2103 * @rmtoll CIR PLL2RDYIE LL_RCC_EnableIT_PLL2RDY
2106 __STATIC_INLINE
void LL_RCC_EnableIT_PLL2RDY(void)
2108 SET_BIT(RCC
->CIR
, RCC_CIR_PLL2RDYIE
);
2110 #endif /* RCC_PLL2_SUPPORT */
2113 * @brief Disable LSI ready interrupt
2114 * @rmtoll CIR LSIRDYIE LL_RCC_DisableIT_LSIRDY
2117 __STATIC_INLINE
void LL_RCC_DisableIT_LSIRDY(void)
2119 CLEAR_BIT(RCC
->CIR
, RCC_CIR_LSIRDYIE
);
2123 * @brief Disable LSE ready interrupt
2124 * @rmtoll CIR LSERDYIE LL_RCC_DisableIT_LSERDY
2127 __STATIC_INLINE
void LL_RCC_DisableIT_LSERDY(void)
2129 CLEAR_BIT(RCC
->CIR
, RCC_CIR_LSERDYIE
);
2133 * @brief Disable HSI ready interrupt
2134 * @rmtoll CIR HSIRDYIE LL_RCC_DisableIT_HSIRDY
2137 __STATIC_INLINE
void LL_RCC_DisableIT_HSIRDY(void)
2139 CLEAR_BIT(RCC
->CIR
, RCC_CIR_HSIRDYIE
);
2143 * @brief Disable HSE ready interrupt
2144 * @rmtoll CIR HSERDYIE LL_RCC_DisableIT_HSERDY
2147 __STATIC_INLINE
void LL_RCC_DisableIT_HSERDY(void)
2149 CLEAR_BIT(RCC
->CIR
, RCC_CIR_HSERDYIE
);
2153 * @brief Disable PLL ready interrupt
2154 * @rmtoll CIR PLLRDYIE LL_RCC_DisableIT_PLLRDY
2157 __STATIC_INLINE
void LL_RCC_DisableIT_PLLRDY(void)
2159 CLEAR_BIT(RCC
->CIR
, RCC_CIR_PLLRDYIE
);
2162 #if defined(RCC_PLLI2S_SUPPORT)
2164 * @brief Disable PLLI2S ready interrupt
2165 * @rmtoll CIR PLL3RDYIE LL_RCC_DisableIT_PLLI2SRDY
2168 __STATIC_INLINE
void LL_RCC_DisableIT_PLLI2SRDY(void)
2170 CLEAR_BIT(RCC
->CIR
, RCC_CIR_PLL3RDYIE
);
2172 #endif /* RCC_PLLI2S_SUPPORT */
2174 #if defined(RCC_PLL2_SUPPORT)
2176 * @brief Disable PLL2 ready interrupt
2177 * @rmtoll CIR PLL2RDYIE LL_RCC_DisableIT_PLL2RDY
2180 __STATIC_INLINE
void LL_RCC_DisableIT_PLL2RDY(void)
2182 CLEAR_BIT(RCC
->CIR
, RCC_CIR_PLL2RDYIE
);
2184 #endif /* RCC_PLL2_SUPPORT */
2187 * @brief Checks if LSI ready interrupt source is enabled or disabled.
2188 * @rmtoll CIR LSIRDYIE LL_RCC_IsEnabledIT_LSIRDY
2189 * @retval State of bit (1 or 0).
2191 __STATIC_INLINE
uint32_t LL_RCC_IsEnabledIT_LSIRDY(void)
2193 return (READ_BIT(RCC
->CIR
, RCC_CIR_LSIRDYIE
) == (RCC_CIR_LSIRDYIE
));
2197 * @brief Checks if LSE ready interrupt source is enabled or disabled.
2198 * @rmtoll CIR LSERDYIE LL_RCC_IsEnabledIT_LSERDY
2199 * @retval State of bit (1 or 0).
2201 __STATIC_INLINE
uint32_t LL_RCC_IsEnabledIT_LSERDY(void)
2203 return (READ_BIT(RCC
->CIR
, RCC_CIR_LSERDYIE
) == (RCC_CIR_LSERDYIE
));
2207 * @brief Checks if HSI ready interrupt source is enabled or disabled.
2208 * @rmtoll CIR HSIRDYIE LL_RCC_IsEnabledIT_HSIRDY
2209 * @retval State of bit (1 or 0).
2211 __STATIC_INLINE
uint32_t LL_RCC_IsEnabledIT_HSIRDY(void)
2213 return (READ_BIT(RCC
->CIR
, RCC_CIR_HSIRDYIE
) == (RCC_CIR_HSIRDYIE
));
2217 * @brief Checks if HSE ready interrupt source is enabled or disabled.
2218 * @rmtoll CIR HSERDYIE LL_RCC_IsEnabledIT_HSERDY
2219 * @retval State of bit (1 or 0).
2221 __STATIC_INLINE
uint32_t LL_RCC_IsEnabledIT_HSERDY(void)
2223 return (READ_BIT(RCC
->CIR
, RCC_CIR_HSERDYIE
) == (RCC_CIR_HSERDYIE
));
2227 * @brief Checks if PLL ready interrupt source is enabled or disabled.
2228 * @rmtoll CIR PLLRDYIE LL_RCC_IsEnabledIT_PLLRDY
2229 * @retval State of bit (1 or 0).
2231 __STATIC_INLINE
uint32_t LL_RCC_IsEnabledIT_PLLRDY(void)
2233 return (READ_BIT(RCC
->CIR
, RCC_CIR_PLLRDYIE
) == (RCC_CIR_PLLRDYIE
));
2236 #if defined(RCC_PLLI2S_SUPPORT)
2238 * @brief Checks if PLLI2S ready interrupt source is enabled or disabled.
2239 * @rmtoll CIR PLL3RDYIE LL_RCC_IsEnabledIT_PLLI2SRDY
2240 * @retval State of bit (1 or 0).
2242 __STATIC_INLINE
uint32_t LL_RCC_IsEnabledIT_PLLI2SRDY(void)
2244 return (READ_BIT(RCC
->CIR
, RCC_CIR_PLL3RDYIE
) == (RCC_CIR_PLL3RDYIE
));
2246 #endif /* RCC_PLLI2S_SUPPORT */
2248 #if defined(RCC_PLL2_SUPPORT)
2250 * @brief Checks if PLL2 ready interrupt source is enabled or disabled.
2251 * @rmtoll CIR PLL2RDYIE LL_RCC_IsEnabledIT_PLL2RDY
2252 * @retval State of bit (1 or 0).
2254 __STATIC_INLINE
uint32_t LL_RCC_IsEnabledIT_PLL2RDY(void)
2256 return (READ_BIT(RCC
->CIR
, RCC_CIR_PLL2RDYIE
) == (RCC_CIR_PLL2RDYIE
));
2258 #endif /* RCC_PLL2_SUPPORT */
2264 #if defined(USE_FULL_LL_DRIVER)
2265 /** @defgroup RCC_LL_EF_Init De-initialization function
2268 ErrorStatus
LL_RCC_DeInit(void);
2273 /** @defgroup RCC_LL_EF_Get_Freq Get system and peripherals clocks frequency functions
2276 void LL_RCC_GetSystemClocksFreq(LL_RCC_ClocksTypeDef
*RCC_Clocks
);
2277 #if defined(RCC_CFGR2_I2S2SRC)
2278 uint32_t LL_RCC_GetI2SClockFreq(uint32_t I2SxSource
);
2279 #endif /* RCC_CFGR2_I2S2SRC */
2280 #if defined(USB_OTG_FS) || defined(USB)
2281 uint32_t LL_RCC_GetUSBClockFreq(uint32_t USBxSource
);
2282 #endif /* USB_OTG_FS || USB */
2283 uint32_t LL_RCC_GetADCClockFreq(uint32_t ADCxSource
);
2287 #endif /* USE_FULL_LL_DRIVER */
2307 #endif /* __STM32F1xx_LL_RCC_H */
2309 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/