RCC clocks control functions.
More...
RCC clocks control functions.
===============================================================================
##### Peripheral Control functions #####
===============================================================================
[..]
This subsection provides a set of functions allowing to control the RCC Clocks
frequencies.
◆ HAL_RCC_CSSCallback()
__weak void HAL_RCC_CSSCallback |
( |
void |
| ) |
|
◆ HAL_RCC_DisableCSS()
void HAL_RCC_DisableCSS |
( |
void |
| ) |
|
◆ HAL_RCC_EnableCSS()
void HAL_RCC_EnableCSS |
( |
void |
| ) |
|
Enables the Clock Security System.
- Note
- If a failure is detected on the HSE oscillator clock, this oscillator is automatically disabled and an interrupt is generated to inform the software about the failure (Clock Security System Interrupt, CSSI), allowing the MCU to perform rescue operations. The CSSI is linked to the Cortex-M4 NMI (Non-Maskable Interrupt) exception vector.
- Return values
-
Definition at line 841 of file stm32f4xx_hal_rcc.c.
◆ HAL_RCC_GetClockConfig()
void HAL_RCC_GetClockConfig |
( |
RCC_ClkInitTypeDef * |
RCC_ClkInitStruct, |
|
|
uint32_t * |
pFLatency |
|
) |
| |
Configures the RCC_ClkInitStruct according to the internal RCC configuration registers.
- Parameters
-
RCC_ClkInitStruct | pointer to an RCC_ClkInitTypeDef structure that will be configured. |
pFLatency | Pointer on the Flash Latency. |
- Return values
-
Definition at line 1058 of file stm32f4xx_hal_rcc.c.
◆ HAL_RCC_GetHCLKFreq()
uint32_t HAL_RCC_GetHCLKFreq |
( |
void |
| ) |
|
Returns the HCLK frequency.
- Note
- Each time HCLK changes, this function must be called to update the right HCLK value. Otherwise, any configuration based on this function will be incorrect.
-
The SystemCoreClock CMSIS variable is used to store System Clock Frequency and updated within this function
- Return values
-
Definition at line 943 of file stm32f4xx_hal_rcc.c.
◆ HAL_RCC_GetOscConfig()
Configures the RCC_OscInitStruct according to the internal RCC configuration registers.
- Parameters
-
- Return values
-
Definition at line 979 of file stm32f4xx_hal_rcc.c.
◆ HAL_RCC_GetPCLK1Freq()
uint32_t HAL_RCC_GetPCLK1Freq |
( |
void |
| ) |
|
Returns the PCLK1 frequency.
- Note
- Each time PCLK1 changes, this function must be called to update the right PCLK1 value. Otherwise, any configuration based on this function will be incorrect.
- Return values
-
Definition at line 954 of file stm32f4xx_hal_rcc.c.
◆ HAL_RCC_GetPCLK2Freq()
uint32_t HAL_RCC_GetPCLK2Freq |
( |
void |
| ) |
|
Returns the PCLK2 frequency.
- Note
- Each time PCLK2 changes, this function must be called to update the right PCLK2 value. Otherwise, any configuration based on this function will be incorrect.
- Return values
-
Definition at line 966 of file stm32f4xx_hal_rcc.c.
◆ HAL_RCC_GetSysClockFreq()
__weak uint32_t HAL_RCC_GetSysClockFreq |
( |
void |
| ) |
|
Returns the SYSCLK frequency.
- Note
- The system frequency computed by this function is not the real frequency in the chip. It is calculated based on the predefined constant and the selected clock source:
-
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(*) multiplied/divided by the PLL factors.
-
(*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h 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 stm32f4xx_hal_conf.h file (default value 25 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 not correct when using fractional value for HSE crystal.
-
This function can be used by the user application to compute the baudrate for the communication peripherals or configure other parameters.
-
Each time SYSCLK changes, this function must be called to update the right SYSCLK value. Otherwise, any configuration based on this function will be incorrect.
- Return values
-
Definition at line 885 of file stm32f4xx_hal_rcc.c.
◆ HAL_RCC_MCOConfig()
void HAL_RCC_MCOConfig |
( |
uint32_t |
RCC_MCOx, |
|
|
uint32_t |
RCC_MCOSource, |
|
|
uint32_t |
RCC_MCODiv |
|
) |
| |
Selects the clock source to output on MCO1 pin(PA8) or on MCO2 pin(PC9).
- Note
- PA8/PC9 should be configured in alternate function mode.
- Parameters
-
RCC_MCOx | specifies the output direction for the clock source. This parameter can be one of the following values:
- RCC_MCO1: Clock source to output on MCO1 pin(PA8).
- RCC_MCO2: Clock source to output on MCO2 pin(PC9).
|
RCC_MCOSource | specifies the clock source to output. This parameter can be one of the following values:
- RCC_MCO1SOURCE_HSI: HSI clock selected as MCO1 source
- RCC_MCO1SOURCE_LSE: LSE clock selected as MCO1 source
- RCC_MCO1SOURCE_HSE: HSE clock selected as MCO1 source
- RCC_MCO1SOURCE_PLLCLK: main PLL clock selected as MCO1 source
- RCC_MCO2SOURCE_SYSCLK: System clock (SYSCLK) selected as MCO2 source
- RCC_MCO2SOURCE_PLLI2SCLK: PLLI2S clock selected as MCO2 source, available for all STM32F4 devices except STM32F410xx
- RCC_MCO2SOURCE_I2SCLK: I2SCLK clock selected as MCO2 source, available only for STM32F410Rx devices
- RCC_MCO2SOURCE_HSE: HSE clock selected as MCO2 source
- RCC_MCO2SOURCE_PLLCLK: main PLL clock selected as MCO2 source
|
RCC_MCODiv | specifies the MCOx prescaler. This parameter can be one of the following values:
- RCC_MCODIV_1: no division applied to MCOx clock
- RCC_MCODIV_2: division by 2 applied to MCOx clock
- RCC_MCODIV_3: division by 3 applied to MCOx clock
- RCC_MCODIV_4: division by 4 applied to MCOx clock
- RCC_MCODIV_5: division by 5 applied to MCOx clock
|
- Note
- For STM32F410Rx devices to output I2SCLK clock on MCO2 you should have at last one of the SPI clocks enabled (SPI1, SPI2 or SPI5).
- Return values
-
Definition at line 775 of file stm32f4xx_hal_rcc.c.
◆ HAL_RCC_NMI_IRQHandler()
void HAL_RCC_NMI_IRQHandler |
( |
void |
| ) |
|
This function handles the RCC CSS interrupt request.
- Note
- This API should be called under the NMI_Handler().
- Return values
-
Definition at line 1084 of file stm32f4xx_hal_rcc.c.