STM32F103xB HAL User Manual
Functions
UTILS Private functions
UTILS

Functions

static uint32_t UTILS_GetPLLOutputFrequency (uint32_t PLL_InputFrequency, LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct)
 Function to check that PLL can be modified.
static ErrorStatus UTILS_PLL_HSE_ConfigSystemClock (uint32_t PLL_InputFrequency, uint32_t HSEBypass, LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct)
 This function enable the HSE when it is used by PLL or PLL2.
static ErrorStatus UTILS_EnablePLLAndSwitchSystem (uint32_t SYSCLK_Frequency, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct)
 Function to enable PLL and switch system clock to PLL.
static ErrorStatus UTILS_PLL_IsBusy (void)
 Function to check that PLL can be modified.

Function Documentation

static ErrorStatus UTILS_EnablePLLAndSwitchSystem ( uint32_t  SYSCLK_Frequency,
LL_UTILS_ClkInitTypeDef UTILS_ClkInitStruct 
) [static]

Function to enable PLL and switch system clock to PLL.

Parameters:
SYSCLK_FrequencySYSCLK frequency
UTILS_ClkInitStructpointer to a LL_UTILS_ClkInitTypeDef structure that contains the configuration information for the BUS prescalers.
Return values:
AnErrorStatus enumeration value:
  • SUCCESS: No problem to switch system to PLL
  • ERROR: Problem to switch system to PLL

Definition at line 681 of file stm32f1xx_ll_utils.c.

References __LL_RCC_CALC_HCLK_FREQ, LL_UTILS_ClkInitTypeDef::AHBCLKDivider, LL_UTILS_ClkInitTypeDef::APB1CLKDivider, LL_UTILS_ClkInitTypeDef::APB2CLKDivider, assert_param, IS_LL_UTILS_APB1_DIV, IS_LL_UTILS_APB2_DIV, IS_LL_UTILS_SYSCLK_DIV, LL_RCC_GetSysClkSource(), LL_RCC_PLL_Enable(), LL_RCC_PLL_GetMainSource(), LL_RCC_PLL_IsReady(), LL_RCC_PLLSOURCE_HSI_DIV_2, LL_RCC_SetAHBPrescaler(), LL_RCC_SetAPB1Prescaler(), LL_RCC_SetAPB2Prescaler(), LL_RCC_SetSysClkSource(), LL_RCC_SYS_CLKSOURCE_PLL, LL_RCC_SYS_CLKSOURCE_STATUS_PLL, LL_SetFlashLatency(), and LL_SetSystemCoreClock().

Referenced by LL_PLL_ConfigSystemClock_HSE(), and LL_PLL_ConfigSystemClock_HSI().

static uint32_t UTILS_GetPLLOutputFrequency ( uint32_t  PLL_InputFrequency,
LL_UTILS_PLLInitTypeDef UTILS_PLLInitStruct 
) [static]

Function to check that PLL can be modified.

Parameters:
PLL_InputFrequencyPLL input frequency (in Hz)
UTILS_PLLInitStructpointer to a LL_UTILS_PLLInitTypeDef structure that contains the configuration information for the PLL.
Return values:
PLLoutput frequency (in Hz)

Definition at line 539 of file stm32f1xx_ll_utils.c.

References __LL_RCC_CALC_PLLCLK_FREQ, assert_param, IS_LL_UTILS_PLL_FREQUENCY, IS_LL_UTILS_PLLMUL_VALUE, LL_UTILS_PLLInitTypeDef::PLLMul, and LL_UTILS_PLLInitTypeDef::Prediv.

Referenced by LL_PLL_ConfigSystemClock_HSE(), and LL_PLL_ConfigSystemClock_HSI().

static ErrorStatus UTILS_PLL_HSE_ConfigSystemClock ( uint32_t  PLL_InputFrequency,
uint32_t  HSEBypass,
LL_UTILS_PLLInitTypeDef UTILS_PLLInitStruct,
LL_UTILS_ClkInitTypeDef UTILS_ClkInitStruct 
) [static]

This function enable the HSE when it is used by PLL or PLL2.

Note:
The application need to ensure that PLL is disabled.
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: HSE configuration done
  • ERROR: HSE configuration not done

Definition at line 572 of file stm32f1xx_ll_utils.c.

References LL_RCC_HSE_DisableBypass(), LL_RCC_HSE_Enable(), LL_RCC_HSE_EnableBypass(), LL_RCC_HSE_IsReady(), LL_UTILS_HSEBYPASS_ON, and UTILS_PLL_IsBusy().

Referenced by LL_PLL_ConfigSystemClock_HSE().

static ErrorStatus UTILS_PLL_IsBusy ( void  ) [static]

Function to check that PLL can be modified.

Return values:
AnErrorStatus enumeration value:
  • SUCCESS: PLL modification can be done
  • ERROR: PLL is busy

Definition at line 641 of file stm32f1xx_ll_utils.c.

References LL_RCC_PLL_IsReady().

Referenced by LL_PLL_ConfigSystemClock_HSI(), and UTILS_PLL_HSE_ConfigSystemClock().