STM32L486xx HAL User Manual
Functions
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:
ADCxSourceThis parameter can be one of the following values:
Return values:
ADCclock frequency (in Hz)

Definition at line 1128 of file stm32l4xx_ll_rcc.c.

References assert_param, IS_LL_RCC_ADC_CLKSOURCE, LL_RCC_ADC_CLKSOURCE_NONE, LL_RCC_ADC_CLKSOURCE_PLLSAI1, LL_RCC_ADC_CLKSOURCE_PLLSAI2, LL_RCC_ADC_CLKSOURCE_SYSCLK, LL_RCC_GetADCClockSource(), LL_RCC_PERIPH_FREQUENCY_NA, LL_RCC_PERIPH_FREQUENCY_NO, LL_RCC_PLLSAI1_IsReady(), LL_RCC_PLLSAI2_IsReady(), RCC_GetSystemClockFreq(), RCC_PLLSAI1_GetFreqDomain_ADC(), and RCC_PLLSAI2_GetFreqDomain_ADC().

uint32_t LL_RCC_GetDFSDMClockFreq ( uint32_t  DFSDMxSource)

Return DFSDMx clock frequency.

Parameters:
DFSDMxSourceThis parameter can be one of the following values:
Return values:
DFSDMclock frequency (in Hz)

Definition at line 1208 of file stm32l4xx_ll_rcc.c.

References assert_param, IS_LL_RCC_DFSDM_CLKSOURCE, LL_RCC_DFSDM1_CLKSOURCE_PCLK2, LL_RCC_DFSDM1_CLKSOURCE_SYSCLK, LL_RCC_GetDFSDMClockSource(), LL_RCC_PERIPH_FREQUENCY_NO, RCC_GetHCLKClockFreq(), RCC_GetPCLK2ClockFreq(), and RCC_GetSystemClockFreq().

uint32_t LL_RCC_GetI2CClockFreq ( uint32_t  I2CxSource)
uint32_t LL_RCC_GetLPTIMClockFreq ( uint32_t  LPTIMxSource)
uint32_t LL_RCC_GetLPUARTClockFreq ( uint32_t  LPUARTxSource)

Return LPUARTx clock frequency.

Parameters:
LPUARTxSourceThis parameter can be one of the following values:
Return values:
LPUARTclock frequency (in Hz)

Definition at line 670 of file stm32l4xx_ll_rcc.c.

References assert_param, HSI_VALUE, IS_LL_RCC_LPUART_CLKSOURCE, LL_RCC_GetLPUARTClockSource(), LL_RCC_HSI_IsReady(), LL_RCC_LPUART1_CLKSOURCE_HSI, LL_RCC_LPUART1_CLKSOURCE_LSE, LL_RCC_LPUART1_CLKSOURCE_PCLK1, LL_RCC_LPUART1_CLKSOURCE_SYSCLK, LL_RCC_LSE_IsReady(), LL_RCC_PERIPH_FREQUENCY_NO, LSE_VALUE, RCC_GetHCLKClockFreq(), RCC_GetPCLK1ClockFreq(), and RCC_GetSystemClockFreq().

Referenced by LL_LPUART_Init().

uint32_t LL_RCC_GetRNGClockFreq ( uint32_t  RNGxSource)
uint32_t LL_RCC_GetSAIClockFreq ( uint32_t  SAIxSource)
uint32_t LL_RCC_GetSDMMCClockFreq ( uint32_t  SDMMCxSource)
uint32_t LL_RCC_GetSWPMIClockFreq ( uint32_t  SWPMIxSource)

Return SWPMIx clock frequency.

Parameters:
SWPMIxSourceThis parameter can be one of the following values:
Return values:
SWPMIclock frequency (in Hz)

Definition at line 1174 of file stm32l4xx_ll_rcc.c.

References assert_param, HSI_VALUE, IS_LL_RCC_SWPMI_CLKSOURCE, LL_RCC_GetSWPMIClockSource(), LL_RCC_HSI_IsReady(), LL_RCC_PERIPH_FREQUENCY_NO, LL_RCC_SWPMI1_CLKSOURCE_HSI, LL_RCC_SWPMI1_CLKSOURCE_PCLK1, RCC_GetHCLKClockFreq(), RCC_GetPCLK1ClockFreq(), and RCC_GetSystemClockFreq().

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_Clockspointer to a LL_RCC_ClocksTypeDef structure which will hold the clocks frequencies
Return values:
None

Definition at line 329 of file stm32l4xx_ll_rcc.c.

References LL_RCC_ClocksTypeDef::HCLK_Frequency, LL_RCC_ClocksTypeDef::PCLK1_Frequency, LL_RCC_ClocksTypeDef::PCLK2_Frequency, RCC_GetHCLKClockFreq(), RCC_GetPCLK1ClockFreq(), RCC_GetPCLK2ClockFreq(), RCC_GetSystemClockFreq(), and LL_RCC_ClocksTypeDef::SYSCLK_Frequency.

uint32_t LL_RCC_GetUARTClockFreq ( uint32_t  UARTxSource)
uint32_t LL_RCC_GetUSARTClockFreq ( uint32_t  USARTxSource)
uint32_t LL_RCC_GetUSBClockFreq ( uint32_t  USBxSource)