Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TUKS-COURSE-TIMER by
Get system and peripherals clocks frequency functions
[RCC Exported Functions]
Return the frequencies of different on chip clocks; System, AHB, APB1 and APB2 buses clocks and different peripheral clocks available on the device. More...
Functions | |
void | LL_RCC_GetSystemClocksFreq (LL_RCC_ClocksTypeDef *RCC_Clocks) |
Return the frequencies of different on chip clocks; System, AHB, APB1 and APB2 buses clocks. | |
uint32_t | LL_RCC_GetUSARTClockFreq (uint32_t USARTxSource) |
Return USARTx clock frequency. | |
uint32_t | LL_RCC_GetUARTClockFreq (uint32_t UARTxSource) |
Return UARTx clock frequency. | |
uint32_t | LL_RCC_GetI2CClockFreq (uint32_t I2CxSource) |
Return I2Cx clock frequency. | |
uint32_t | LL_RCC_GetLPUARTClockFreq (uint32_t LPUARTxSource) |
Return LPUARTx clock frequency. | |
uint32_t | LL_RCC_GetLPTIMClockFreq (uint32_t LPTIMxSource) |
Return LPTIMx clock frequency. | |
uint32_t | LL_RCC_GetSAIClockFreq (uint32_t SAIxSource) |
Return SAIx clock frequency. | |
uint32_t | LL_RCC_GetSDMMCClockFreq (uint32_t SDMMCxSource) |
Return SDMMCx clock frequency. | |
uint32_t | LL_RCC_GetRNGClockFreq (uint32_t RNGxSource) |
Return RNGx clock frequency. | |
uint32_t | LL_RCC_GetUSBClockFreq (uint32_t USBxSource) |
Return USBx clock frequency. | |
uint32_t | LL_RCC_GetADCClockFreq (uint32_t ADCxSource) |
Return ADCx clock frequency. | |
uint32_t | LL_RCC_GetSWPMIClockFreq (uint32_t SWPMIxSource) |
Return SWPMIx clock frequency. | |
uint32_t | LL_RCC_GetDFSDMClockFreq (uint32_t DFSDMxSource) |
Return DFSDMx clock frequency. |
Detailed Description
Return the frequencies of different on chip clocks; System, AHB, APB1 and APB2 buses clocks and different peripheral clocks available on the device.
- Note:
- If SYSCLK source is MSI, function returns values based on MSI_VALUE(*)
- If SYSCLK source is HSI, function returns values based on HSI_VALUE(**)
- If SYSCLK source is HSE, function returns values based on HSE_VALUE(***)
- If SYSCLK source is PLL, function returns values based on HSE_VALUE(***) or HSI_VALUE(**) or MSI_VALUE(*) multiplied/divided by the PLL factors.
- (*) MSI_VALUE is a constant defined in this file (default value 4 MHz) but the real value may vary depending on the variations in voltage and temperature.
- (**) HSI_VALUE is a constant defined in this file (default value 16 MHz) but the real value may vary depending on the variations in voltage and temperature.
- (***) HSE_VALUE is a constant defined in this file (default value 8 MHz), user has to ensure that HSE_VALUE is same as the real frequency of the crystal used. Otherwise, this function may have wrong result.
- The result of this function could be incorrect when using fractional value for HSE crystal.
- This function can be used by the user application to compute the baud-rate for the communication peripherals or configure other parameters.
Function Documentation
uint32_t LL_RCC_GetADCClockFreq | ( | uint32_t | ADCxSource ) |
Return ADCx clock frequency.
- Parameters:
-
ADCxSource This parameter can be one of the following values: - LL_RCC_ADC_CLKSOURCE
- Return values:
-
ADC clock frequency (in Hz) - LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (MSI) or PLL is not ready
- LL_RCC_PERIPH_FREQUENCY_NA indicates that no clock source selected
Definition at line 962 of file stm32l4xx_ll_rcc.c.
uint32_t LL_RCC_GetDFSDMClockFreq | ( | uint32_t | DFSDMxSource ) |
Return DFSDMx clock frequency.
- Parameters:
-
DFSDMxSource This parameter can be one of the following values: - LL_RCC_DFSDM1_CLKSOURCE
- Return values:
-
DFSDM clock frequency (in Hz)
Definition at line 1040 of file stm32l4xx_ll_rcc.c.
uint32_t LL_RCC_GetI2CClockFreq | ( | uint32_t | I2CxSource ) |
Return I2Cx clock frequency.
- Parameters:
-
I2CxSource This parameter can be one of the following values: - LL_RCC_I2C1_CLKSOURCE
- LL_RCC_I2C2_CLKSOURCE (*)
(*) value not defined in all devices.
- LL_RCC_I2C3_CLKSOURCE
- Return values:
-
I2C clock frequency (in Hz) - LL_RCC_PERIPH_FREQUENCY_NO indicates that HSI oscillator is not ready
Definition at line 492 of file stm32l4xx_ll_rcc.c.
uint32_t LL_RCC_GetLPTIMClockFreq | ( | uint32_t | LPTIMxSource ) |
Return LPTIMx clock frequency.
- Parameters:
-
LPTIMxSource This parameter can be one of the following values: - LL_RCC_LPTIM1_CLKSOURCE
- LL_RCC_LPTIM2_CLKSOURCE
- Return values:
-
LPTIM clock frequency (in Hz) - LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (HSI or LSE) is not ready
Definition at line 626 of file stm32l4xx_ll_rcc.c.
uint32_t LL_RCC_GetLPUARTClockFreq | ( | uint32_t | LPUARTxSource ) |
Return LPUARTx clock frequency.
- Parameters:
-
LPUARTxSource This parameter can be one of the following values: - LL_RCC_LPUART1_CLKSOURCE
- Return values:
-
LPUART clock frequency (in Hz) - LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (HSI or LSE) is not ready
Definition at line 581 of file stm32l4xx_ll_rcc.c.
uint32_t LL_RCC_GetRNGClockFreq | ( | uint32_t | RNGxSource ) |
Return RNGx clock frequency.
- Parameters:
-
RNGxSource This parameter can be one of the following values: - LL_RCC_RNG_CLKSOURCE
- Return values:
-
RNG clock frequency (in Hz) - LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (MSI) or PLL is not ready
- LL_RCC_PERIPH_FREQUENCY_NA indicates that no clock source selected
Definition at line 858 of file stm32l4xx_ll_rcc.c.
uint32_t LL_RCC_GetSAIClockFreq | ( | uint32_t | SAIxSource ) |
Return SAIx clock frequency.
- Parameters:
-
SAIxSource This parameter can be one of the following values: - LL_RCC_SAI1_CLKSOURCE
- LL_RCC_SAI2_CLKSOURCE (*)
(*) value not defined in all devices.
- Return values:
-
SAI clock frequency (in Hz) - LL_RCC_PERIPH_FREQUENCY_NO indicates that PLL is not ready
- LL_RCC_PERIPH_FREQUENCY_NA indicates that external clock is used
Definition at line 715 of file stm32l4xx_ll_rcc.c.
uint32_t LL_RCC_GetSDMMCClockFreq | ( | uint32_t | SDMMCxSource ) |
Return SDMMCx clock frequency.
- Parameters:
-
SDMMCxSource This parameter can be one of the following values: - LL_RCC_SDMMC1_CLKSOURCE
- Return values:
-
SDMMC clock frequency (in Hz) - LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (MSI) or PLL is not ready
- LL_RCC_PERIPH_FREQUENCY_NA indicates that no clock source selected
Definition at line 807 of file stm32l4xx_ll_rcc.c.
uint32_t LL_RCC_GetSWPMIClockFreq | ( | uint32_t | SWPMIxSource ) |
Return SWPMIx clock frequency.
- Parameters:
-
SWPMIxSource This parameter can be one of the following values: - LL_RCC_SWPMI1_CLKSOURCE
- Return values:
-
SWPMI clock frequency (in Hz) - LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (HSI) is not ready
Definition at line 1007 of file stm32l4xx_ll_rcc.c.
void LL_RCC_GetSystemClocksFreq | ( | LL_RCC_ClocksTypeDef * | RCC_Clocks ) |
Return the frequencies of different on chip clocks; System, AHB, APB1 and APB2 buses clocks.
- Note:
- Each time SYSCLK, HCLK, PCLK1 and/or PCLK2 clock changes, this function must be called to update structure fields. Otherwise, any configuration based on this function will be incorrect.
- Parameters:
-
RCC_Clocks pointer to a LL_RCC_ClocksTypeDef structure which will hold the clocks frequencies
- Return values:
-
None
Definition at line 269 of file stm32l4xx_ll_rcc.c.
uint32_t LL_RCC_GetUARTClockFreq | ( | uint32_t | UARTxSource ) |
Return UARTx clock frequency.
- Parameters:
-
UARTxSource This parameter can be one of the following values: - LL_RCC_UART4_CLKSOURCE
- LL_RCC_UART5_CLKSOURCE
- Return values:
-
UART clock frequency (in Hz) - LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (HSI or LSE) is not ready
Definition at line 406 of file stm32l4xx_ll_rcc.c.
uint32_t LL_RCC_GetUSARTClockFreq | ( | uint32_t | USARTxSource ) |
Return USARTx clock frequency.
- Parameters:
-
USARTxSource This parameter can be one of the following values: - LL_RCC_USART1_CLKSOURCE
- LL_RCC_USART2_CLKSOURCE
- LL_RCC_USART3_CLKSOURCE (*)
(*) value not defined in all devices.
- Return values:
-
USART clock frequency (in Hz) - LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (HSI or LSE) is not ready
Definition at line 295 of file stm32l4xx_ll_rcc.c.
uint32_t LL_RCC_GetUSBClockFreq | ( | uint32_t | USBxSource ) |
Return USBx clock frequency.
- Parameters:
-
USBxSource This parameter can be one of the following values: - LL_RCC_USB_CLKSOURCE
- Return values:
-
USB clock frequency (in Hz) - LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (MSI) or PLL is not ready
- LL_RCC_PERIPH_FREQUENCY_NA indicates that no clock source selected
Definition at line 910 of file stm32l4xx_ll_rcc.c.
Generated on Tue Jul 12 2022 17:38:58 by
