Extended Peripheral Control functions.
More...
Extended Peripheral Control functions.
===============================================================================
##### Extended Peripheral Control functions #####
===============================================================================
[..]
This subsection provides a set of functions allowing to control the RCC Clocks
frequencies.
[..]
(@) Important note: Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to
select the RTC clock source; in this case the Backup domain will be reset in
order to modify the RTC Clock source, as consequence RTC registers (including
the backup registers) and RCC_BDCR register are set to their reset values.
◆ HAL_RCC_GetSysClockFreq()
uint32_t HAL_RCC_GetSysClockFreq |
( |
void |
| ) |
|
Returns the SYSCLK frequency.
- Note
- This function implementation is valid only for STM32F446xx devices.
-
This function add the PLL/PLLR System clock source
-
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 or PLLR, 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 3094 of file stm32f4xx_hal_rcc_ex.c.
◆ HAL_RCCEx_DisablePLLI2S()
HAL_StatusTypeDef HAL_RCCEx_DisablePLLI2S |
( |
void |
| ) |
|
◆ HAL_RCCEx_DisablePLLSAI()
HAL_StatusTypeDef HAL_RCCEx_DisablePLLSAI |
( |
void |
| ) |
|
◆ HAL_RCCEx_EnablePLLI2S()
◆ HAL_RCCEx_EnablePLLSAI()
◆ HAL_RCCEx_GetPeriphCLKConfig()
Get the RCC_PeriphCLKInitTypeDef according to the internal RCC configuration registers.
Configures the PeriphClkInit according to the internal RCC configuration registers.
Configures the RCC_OscInitStruct according to the internal RCC configuration registers.
Configures the RCC_PeriphCLKInitTypeDef according to the internal RCC configuration registers.
- Parameters
-
- Return values
-
Definition at line 500 of file stm32f4xx_hal_rcc_ex.c.
◆ HAL_RCCEx_GetPeriphCLKFreq()
uint32_t HAL_RCCEx_GetPeriphCLKFreq |
( |
uint32_t |
PeriphClk | ) |
|
Return the peripheral clock frequency for a given peripheral(SAI..)
Return the peripheral clock frequency for a given peripheral(I2S..)
- Note
- Return 0 if peripheral clock identifier not managed by this API
- Parameters
-
PeriphClk | Peripheral clock identifier This parameter can be one of the following values:
- RCC_PERIPHCLK_SAI1: SAI1 peripheral clock
- RCC_PERIPHCLK_SAI2: SAI2 peripheral clock
- RCC_PERIPHCLK_I2S_APB1: I2S APB1 peripheral clock
- RCC_PERIPHCLK_I2S_APB2: I2S APB2 peripheral clock
|
- Return values
-
- Note
- Return 0 if peripheral clock identifier not managed by this API
- Parameters
-
PeriphClk | Peripheral clock identifier This parameter can be one of the following values:
- RCC_PERIPHCLK_I2S: I2S peripheral clock
|
- Return values
-
- Note
- Return 0 if peripheral clock identifier not managed by this API
- Parameters
-
PeriphClk | Peripheral clock identifier This parameter can be one of the following values:
- RCC_PERIPHCLK_I2S_APB1: I2S APB1 peripheral clock
- RCC_PERIPHCLK_I2S_APB2: I2S APB2 peripheral clock
|
- Return values
-
Definition at line 580 of file stm32f4xx_hal_rcc_ex.c.
◆ HAL_RCCEx_PeriphCLKConfig()
Initializes the RCC extended peripherals clocks according to the specified parameters in the RCC_PeriphCLKInitTypeDef.
- Parameters
-
PeriphClkInit | pointer to an RCC_PeriphCLKInitTypeDef structure that contains the configuration information for the Extended Peripherals clocks(I2S, SAI, LTDC RTC and TIM). |
- Note
- Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to select the RTC clock source; in this case the Backup domain will be reset in order to modify the RTC Clock source, as consequence RTC registers (including the backup registers) and RCC_BDCR register are set to their reset values.
- Return values
-
- Parameters
-
PeriphClkInit | pointer to an RCC_PeriphCLKInitTypeDef structure that contains the configuration information for the Extended Peripherals clocks(I2S, SAI, LTDC, RTC and TIM). |
- Note
- Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to select the RTC clock source; in this case the Backup domain will be reset in order to modify the RTC Clock source, as consequence RTC registers (including the backup registers) and RCC_BDCR register are set to their reset values.
- Return values
-
- Parameters
-
PeriphClkInit | pointer to an RCC_PeriphCLKInitTypeDef structure that contains the configuration information for the Extended Peripherals clocks(I2S, LTDC RTC and TIM). |
- Note
- Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to select the RTC clock source; in this case the Backup domain will be reset in order to modify the RTC Clock source, as consequence RTC registers (including the backup registers) and RCC_BDCR register are set to their reset values.
- Return values
-
- Parameters
-
PeriphClkInit | pointer to an RCC_PeriphCLKInitTypeDef structure that contains the configuration information for the Extended Peripherals clocks(I2S and RTC clocks). |
- Note
- A caution to be taken when HAL_RCCEx_PeriphCLKConfig() is used to select RTC clock selection, in this case the Reset of Backup domain will be applied in order to modify the RTC Clock source as consequence all backup domain (RTC and RCC_BDCR register expect BKPSRAM) will be reset
- Return values
-
Definition at line 87 of file stm32f4xx_hal_rcc_ex.c.
◆ HAL_RCCEx_SelectLSEMode()
void HAL_RCCEx_SelectLSEMode |
( |
uint8_t |
Mode | ) |
|
Select LSE mode.
- Note
- This mode is only available for STM32F410xx/STM32F411xx/STM32F446xx/STM32F469xx/STM32F479xx/STM32F412Zx/STM32F412Vx/STM32F412Rx/STM32F412Cx devices.
- Parameters
-
Mode | specifies the LSE mode. This parameter can be one of the following values:
- RCC_LSE_LOWPOWER_MODE: LSE oscillator in low power mode selection
- RCC_LSE_HIGHDRIVE_MODE: LSE oscillator in High Drive mode selection
|
- Return values
-
Definition at line 2809 of file stm32f4xx_hal_rcc_ex.c.