Struct stm32f1xx_hal::rcc::CFGR
source · [−]pub struct CFGR { /* private fields */ }
Expand description
Clock configuration register (CFGR)
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
sourceimpl CFGR
impl CFGR
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 freeze(self, acr: &mut ACR) -> Clocks
pub fn freeze(self, acr: &mut ACR) -> Clocks
Applies the clock configuration and returns a Clocks
struct that signifies that the
clocks are frozen, and contains the frequencies used. After this function is called,
the clocks can not change
Usage:
let dp = pac::Peripherals::take().unwrap();
let mut flash = dp.FLASH.constrain();
let mut rcc = dp.RCC.constrain();
let clocks = rcc.cfgr.freeze(&mut flash.acr);
pub fn freeze_with_config(self, cfg: Config, acr: &mut ACR) -> Clocks
Trait Implementations
impl StructuralPartialEq for CFGR
Auto Trait Implementations
impl RefUnwindSafe for CFGR
impl Send for CFGR
impl Sync for CFGR
impl Unpin for CFGR
impl UnwindSafe for CFGR
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more