Reset and clock control (RCC)
selected, the switch will occur when the clock source will be
ready. You can use RCC_GetSYSCLKSource() function to
know which clock is currently used as system clock source.
18.2.7.2 RCC_GetSYSCLKSource
uint8_t RCC_GetSYSCLKSource ( void )
Returns the clock source used as system clock.
ï‚· The clock source used as system clock. The returned
value can be one of the following values:
ï€ 0x00: HSI used as system clock
ï€ 0x04: HSE used as system clock
ï€ 0x08: PLL used as system clock
18.2.7.3 RCC_HCLKConfig
void RCC_HCLKConfig ( uint32_t RCC_SYSCLK)
Configures the AHB clock (HCLK).
ï‚· RCC_SYSCLK : defines the AHB clock divider. This clock is
derived from the system clock (SYSCLK). This parameter can
be one of the following values:
ï€ RCC_SYSCLK_Div1 : AHB clock = SYSCLK
ï€ RCC_SYSCLK_Div2 : AHB clock = SYSCLK/2
ï€ RCC_SYSCLK_Div4 : AHB clock = SYSCLK/4
ï€ RCC_SYSCLK_Div8 : AHB clock = SYSCLK/8
ï€ RCC_SYSCLK_Div16 : AHB clock = SYSCLK/16
ï€ RCC_SYSCLK_Div64 : AHB clock = SYSCLK/64
ï€ RCC_SYSCLK_Div128 : AHB clock = SYSCLK/128
ï€ RCC_SYSCLK_Div256 : AHB clock = SYSCLK/256
ï€ RCC_SYSCLK_Div512 : AHB clock = SYSCLK/512
ï‚· Depending on the device voltage range, the software has to
set correctly these bits to ensure that the system frequency
does not exceed the maximum allowed frequency (for more