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