А это - не то, что требуется?
Код
/*******************************************************************************
* Function Name : RCC_SYSCLKConfig
* Description : Configures the system clock (SYSCLK).
* Input : - RCC_SYSCLKSource: specifies the clock source used as system
* clock. This parameter can be one of the following values:
* - RCC_SYSCLKSource_HSI: HSI selected as system clock
* - RCC_SYSCLKSource_HSE: HSE selected as system clock
* - RCC_SYSCLKSource_PLLCLK: PLL selected as system clock
* Output : None
* Return : None
*******************************************************************************/
void RCC_SYSCLKConfig(u32 RCC_SYSCLKSource)
{
u32 tmpreg = 0;
/* Check the parameters */
assert(IS_RCC_SYSCLK_SOURCE(RCC_SYSCLKSource));
tmpreg = RCC->CFGR;
/* Clear SW[1:0] bits */
tmpreg &= CFGR_SW_Mask;
/* Set SW[1:0] bits according to RCC_SYSCLKSource value */
tmpreg |= RCC_SYSCLKSource;
/* Store the new value */
RCC->CFGR = tmpreg;
}