Hal Drivers for L4
Dependents: BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo
Fork of STM32L4xx_HAL_Driver by
Peripheral Control functions
[RCC Exported Functions]
RCC clocks control functions. More...
Functions | |
void | HAL_RCC_MCOConfig (uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv) |
Select the clock source to output on MCO pin(PA8). | |
uint32_t | HAL_RCC_GetSysClockFreq (void) |
Return the SYSCLK frequency. | |
uint32_t | HAL_RCC_GetHCLKFreq (void) |
Return the HCLK frequency. | |
uint32_t | HAL_RCC_GetPCLK1Freq (void) |
Return the PCLK1 frequency. | |
uint32_t | HAL_RCC_GetPCLK2Freq (void) |
Return the PCLK2 frequency. | |
void | HAL_RCC_GetOscConfig (RCC_OscInitTypeDef *RCC_OscInitStruct) |
Configure the RCC_OscInitStruct according to the internal RCC configuration registers. | |
void | HAL_RCC_GetClockConfig (RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t *pFLatency) |
Configure the RCC_ClkInitStruct according to the internal RCC configuration registers. | |
void | HAL_RCC_EnableCSS (void) |
Enable the Clock Security System. | |
void | HAL_RCC_NMI_IRQHandler (void) |
Handle the RCC Clock Security System interrupt request. | |
__weak void | HAL_RCC_CSSCallback (void) |
RCC Clock Security System interrupt callback. |
Detailed Description
RCC clocks control functions.
=============================================================================== ##### Peripheral Control functions ##### =============================================================================== [..] This subsection provides a set of functions allowing to: (+) Ouput clock to MCO pin. (+) Retrieve current clock frequencies. (+) Enable the Clock Security System.
Function Documentation
__weak void HAL_RCC_CSSCallback | ( | void | ) |
RCC Clock Security System interrupt callback.
- Return values:
-
none
Definition at line 1435 of file stm32l4xx_hal_rcc.c.
void HAL_RCC_EnableCSS | ( | void | ) |
Enable 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.
- The Clock Security System can only be cleared by reset.
- Return values:
-
None
Definition at line 1408 of file stm32l4xx_hal_rcc.c.
void HAL_RCC_GetClockConfig | ( | RCC_ClkInitTypeDef * | RCC_ClkInitStruct, |
uint32_t * | pFLatency | ||
) |
Configure 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:
-
None
Definition at line 1373 of file stm32l4xx_hal_rcc.c.
uint32_t HAL_RCC_GetHCLKFreq | ( | void | ) |
Return 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:
-
HCLK frequency
Definition at line 1233 of file stm32l4xx_hal_rcc.c.
void HAL_RCC_GetOscConfig | ( | RCC_OscInitTypeDef * | RCC_OscInitStruct ) |
Configure the RCC_OscInitStruct according to the internal RCC configuration registers.
- Parameters:
-
RCC_OscInitStruct pointer to an RCC_OscInitTypeDef structure that will be configured.
- Return values:
-
None
Definition at line 1270 of file stm32l4xx_hal_rcc.c.
uint32_t HAL_RCC_GetPCLK1Freq | ( | void | ) |
Return 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:
-
PCLK1 frequency
Definition at line 1245 of file stm32l4xx_hal_rcc.c.
uint32_t HAL_RCC_GetPCLK2Freq | ( | void | ) |
Return 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:
-
PCLK2 frequency
Definition at line 1257 of file stm32l4xx_hal_rcc.c.
uint32_t HAL_RCC_GetSysClockFreq | ( | void | ) |
Return 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 MSI, function returns values based on MSI Value as defined by the MSI range.
- 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(**), HSI_VALUE(*) or MSI Value multiplied/divided by the PLL factors.
- (*) HSI_VALUE is a constant defined in stm32l4xx_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 stm32l4xx_hal_conf.h 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 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:
-
SYSCLK frequency
Definition at line 1153 of file stm32l4xx_hal_rcc.c.
void HAL_RCC_MCOConfig | ( | uint32_t | RCC_MCOx, |
uint32_t | RCC_MCOSource, | ||
uint32_t | RCC_MCODiv | ||
) |
Select the clock source to output on MCO pin(PA8).
- Note:
- PA8 should be configured in alternate function mode.
- Parameters:
-
RCC_MCOx specifies the output direction for the clock source. For STM32L4xx family this parameter can have only one value: - RCC_MCO1 Clock source to output on MCO1 pin(PA8).
RCC_MCOSource specifies the clock source to output. This parameter can be one of the following values: - RCC_MCO1SOURCE_NOCLOCK MCO output disabled, no clock on MCO
- RCC_MCO1SOURCE_SYSCLK system clock selected as MCO source
- RCC_MCO1SOURCE_MSI MSI clock selected as MCO source
- RCC_MCO1SOURCE_HSI HSI clock selected as MCO source
- RCC_MCO1SOURCE_HSE HSE clock selected as MCO sourcee
- RCC_MCO1SOURCE_PLLCLK main PLL clock selected as MCO source
- RCC_MCO1SOURCE_LSI LSI clock selected as MCO source
- RCC_MCO1SOURCE_LSE LSE clock selected as MCO source
RCC_MCODiv specifies the MCO prescaler. This parameter can be one of the following values: - RCC_MCODIV_1 no division applied to MCO clock
- RCC_MCODIV_2 division by 2 applied to MCO clock
- RCC_MCODIV_4 division by 4 applied to MCO clock
- RCC_MCODIV_8 division by 8 applied to MCO clock
- RCC_MCODIV_16 division by 16 applied to MCO clock
- Return values:
-
None
Definition at line 1098 of file stm32l4xx_hal_rcc.c.
void HAL_RCC_NMI_IRQHandler | ( | void | ) |
Handle the RCC Clock Security System interrupt request.
- Note:
- This API should be called under the NMI_Handler().
- Return values:
-
None
Definition at line 1418 of file stm32l4xx_hal_rcc.c.
Generated on Tue Jul 12 2022 11:35:30 by
