STM32F103xB HAL User Manual
Functions
SYSTEM
UTILS Exported Functions

System Configuration functions. More...

Functions

void LL_SetSystemCoreClock (uint32_t HCLKFrequency)
 This function sets directly SystemCoreClock CMSIS variable.
ErrorStatus LL_SetFlashLatency (uint32_t Frequency)
 Update number of Flash wait states in line with new frequency and current voltage range.
ErrorStatus LL_PLL_ConfigSystemClock_HSI (LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct)
 This function configures system clock with HSI as clock source of the PLL.
ErrorStatus LL_PLL_ConfigSystemClock_HSE (uint32_t HSEFrequency, uint32_t HSEBypass, LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct)
 This function configures system clock with HSE as clock source of the PLL.

Detailed Description

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.
  

Function Documentation

ErrorStatus LL_PLL_ConfigSystemClock_HSE ( uint32_t  HSEFrequency,
uint32_t  HSEBypass,
LL_UTILS_PLLInitTypeDef UTILS_PLLInitStruct,
LL_UTILS_ClkInitTypeDef UTILS_ClkInitStruct 
)

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:
HSEFrequencyValue between Min_Data = RCC_HSE_MIN and Max_Data = RCC_HSE_MAX
HSEBypassThis parameter can be one of the following values:
UTILS_PLLInitStructpointer to a LL_UTILS_PLLInitTypeDef structure that contains the configuration information for the PLL.
UTILS_ClkInitStructpointer to a LL_UTILS_ClkInitTypeDef structure that contains the configuration information for the BUS prescalers.
Return values:
AnErrorStatus enumeration value:
  • SUCCESS: Max frequency configuration done
  • ERROR: Max frequency configuration not done

Definition at line 430 of file stm32f1xx_ll_utils.c.

References assert_param, IS_LL_UTILS_HSE_BYPASS, IS_LL_UTILS_HSE_FREQUENCY, IS_LL_UTILS_PREDIV_VALUE, LL_RCC_PLL_ConfigDomain_SYS(), LL_RCC_PLLSOURCE_HSE, LL_UTILS_PLLInitTypeDef::PLLMul, LL_UTILS_PLLInitTypeDef::Prediv, UTILS_EnablePLLAndSwitchSystem(), UTILS_GetPLLOutputFrequency(), and UTILS_PLL_HSE_ConfigSystemClock().

ErrorStatus LL_PLL_ConfigSystemClock_HSI ( LL_UTILS_PLLInitTypeDef UTILS_PLLInitStruct,
LL_UTILS_ClkInitTypeDef UTILS_ClkInitStruct 
)

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_PLLInitStructpointer to a LL_UTILS_PLLInitTypeDef structure that contains the configuration information for the PLL.
UTILS_ClkInitStructpointer to a LL_UTILS_ClkInitTypeDef structure that contains the configuration information for the BUS prescalers.
Return values:
AnErrorStatus enumeration value:
  • SUCCESS: Max frequency configuration done
  • ERROR: Max frequency configuration not done

Definition at line 365 of file stm32f1xx_ll_utils.c.

References assert_param, HSI_VALUE, IS_LL_UTILS_PREDIV_VALUE, LL_RCC_HSI_Enable(), LL_RCC_HSI_IsReady(), LL_RCC_PLL_ConfigDomain_SYS(), LL_RCC_PLLSOURCE_HSI_DIV_2, LL_RCC_PREDIV_DIV_2, LL_UTILS_PLLInitTypeDef::PLLMul, LL_UTILS_PLLInitTypeDef::Prediv, UTILS_EnablePLLAndSwitchSystem(), UTILS_GetPLLOutputFrequency(), and UTILS_PLL_IsBusy().

ErrorStatus LL_SetFlashLatency ( uint32_t  Frequency)

Update number of Flash wait states in line with new frequency and current voltage range.

Parameters:
FrequencySYSCLK frequency
Return values:
AnErrorStatus enumeration value:
  • SUCCESS: Latency has been modified
  • ERROR: Latency cannot be modified

Definition at line 285 of file stm32f1xx_ll_utils.c.

References LL_FLASH_GetLatency(), LL_FLASH_LATENCY_0, LL_FLASH_LATENCY_1, LL_FLASH_LATENCY_2, LL_FLASH_SetLatency(), UTILS_LATENCY1_FREQ, and UTILS_LATENCY2_FREQ.

Referenced by UTILS_EnablePLLAndSwitchSystem().

void LL_SetSystemCoreClock ( uint32_t  HCLKFrequency)

This function sets directly SystemCoreClock CMSIS variable.

Note:
Variable can be calculated also through SystemCoreClockUpdate function.
Parameters:
HCLKFrequencyHCLK frequency in Hz (can be calculated thanks to RCC helper macro)
Return values:
None

Definition at line 270 of file stm32f1xx_ll_utils.c.

Referenced by UTILS_EnablePLLAndSwitchSystem().