pub struct Config { /* private fields */ }
Expand description
Clock configuration
Used to configure the frequencies of the clocks present in the processor.
After setting all frequencies, call the freeze function to apply the configuration.
NOTE: Currently, it is not guaranteed that the exact frequencies selected will be used, only frequencies close to it.
Implementations§
Source§impl Config
impl Config
pub const DEFAULT: Self
pub fn hsi() -> Self
pub fn hse(freq: Hertz) -> Self
Sourcepub fn use_hse(self, freq: Hertz) -> Self
pub fn use_hse(self, freq: Hertz) -> Self
Uses HSE (external oscillator) instead of HSI (internal RC oscillator) as the clock source. Will result in a hang if an external oscillator is not connected or it fails to start. The frequency specified must be the frequency of the external oscillator
Sourcepub fn bypass_hse_oscillator(self) -> Self
pub fn bypass_hse_oscillator(self) -> Self
Bypasses the high-speed external oscillator and uses an external clock input on the OSC_IN pin.
For this configuration, the OSC_IN pin should be connected to a clock source with a frequency specified in the call to use_hse(), and the OSC_OUT pin should not be connected.
This function has no effect unless use_hse() is also called.