System Configuration functions.
More...
System Configuration functions.
===============================================================================
##### System Configuration functions #####
===============================================================================
[..]
System, AHB and APB buses clocks configuration
(+) The maximum frequency of the SYSCLK, HCLK, PCLK1 and PCLK2 is RCC_MAX_FREQUENCY Hz.
◆ LL_PLL_ConfigSystemClock_HSE()
This function configures system clock with HSE as clock source of the PLL.
- Note
- The application need to ensure that PLL is disabled.
-
Function is based on the following formula:
- PLL output frequency = ((HSI frequency / PREDIV) * PLLMUL)
- PREDIV: Set to 2 for few devices
- PLLMUL: The application software must set correctly the PLL multiplication factor to not exceed UTILS_PLL_OUTPUT_MAX
-
FLASH latency can be modified through this function.
- Parameters
-
HSEFrequency | Value between Min_Data = RCC_HSE_MIN and Max_Data = RCC_HSE_MAX |
HSEBypass | This parameter can be one of the following values:
|
UTILS_PLLInitStruct | pointer to a LL_UTILS_PLLInitTypeDef structure that contains the configuration information for the PLL. |
UTILS_ClkInitStruct | pointer to a LL_UTILS_ClkInitTypeDef structure that contains the configuration information for the BUS prescalers. |
- Return values
-
An | ErrorStatus enumeration value:
- SUCCESS: Max frequency configuration done
- ERROR: Max frequency configuration not done
|
Definition at line 399 of file stm32f1xx_ll_utils.c.
403 uint32_t pllfreq = 0U;
418 if (LL_RCC_HSE_IsReady() != 1U)
423 LL_RCC_HSE_EnableBypass();
427 LL_RCC_HSE_DisableBypass();
432 while (LL_RCC_HSE_IsReady() != 1U)
◆ LL_PLL_ConfigSystemClock_HSI()
Update number of Flash wait states in line with new frequency and current voltage range.
- Parameters
-
Frequency | SYSCLK frequency |
- Return values
-
An | ErrorStatus enumeration value:
- SUCCESS: Latency has been modified
- ERROR: Latency cannot be modified
|
This function configures system clock with HSI as clock source of the PLL
- Note
- The application need to ensure that PLL is disabled.
-
Function is based on the following formula:
- PLL output frequency = ((HSI frequency / PREDIV) * PLLMUL)
- PREDIV: Set to 2 for few devices
- PLLMUL: The application software must set correctly the PLL multiplication factor to not exceed 72MHz
-
FLASH latency can be modified through this function.
- Parameters
-
UTILS_PLLInitStruct | pointer to a LL_UTILS_PLLInitTypeDef structure that contains the configuration information for the PLL. |
UTILS_ClkInitStruct | pointer to a LL_UTILS_ClkInitTypeDef structure that contains the configuration information for the BUS prescalers. |
- Return values
-
An | ErrorStatus enumeration value:
- SUCCESS: Max frequency configuration done
- ERROR: Max frequency configuration not done
|
Definition at line 334 of file stm32f1xx_ll_utils.c.
338 uint32_t pllfreq = 0U;
343 #if defined(RCC_PLLSRC_PREDIV1_SUPPORT)
348 UTILS_PLLInitStruct->
Prediv = LL_RCC_PREDIV_DIV_2;
354 if (LL_RCC_HSI_IsReady() != 1U)
357 while (LL_RCC_HSI_IsReady() != 1U)
364 LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSI_DIV_2, UTILS_PLLInitStruct->
PLLMul);
◆ LL_SetSystemCoreClock()
void LL_SetSystemCoreClock |
( |
uint32_t |
HCLKFrequency | ) |
|
This function sets directly SystemCoreClock CMSIS variable.
- Note
- Variable can be calculated also through SystemCoreClockUpdate function.
- Parameters
-
HCLKFrequency | HCLK frequency in Hz (can be calculated thanks to RCC helper macro) |
- Return values
-
Definition at line 240 of file stm32f1xx_ll_utils.c.