Struct rp2040_hal::xosc::CrystalOscillator
source · pub struct CrystalOscillator<S: State> { /* private fields */ }
Expand description
A Crystal Oscillator.
Implementations§
source§impl<S: State> CrystalOscillator<S>
impl<S: State> CrystalOscillator<S>
source§impl CrystalOscillator<Disabled>
impl CrystalOscillator<Disabled>
sourcepub fn initialize(
self,
frequency: HertzU32,
startup_delay_multiplier: u32
) -> Result<CrystalOscillator<Unstable>, Error>
pub fn initialize( self, frequency: HertzU32, startup_delay_multiplier: u32 ) -> Result<CrystalOscillator<Unstable>, Error>
Initializes the XOSC : frequency range is set, startup delay is calculated and set. Set startup_delay_multiplier to a value > 1 when using a slow-starting oscillator.
source§impl CrystalOscillator<Unstable>
impl CrystalOscillator<Unstable>
sourcepub fn await_stabilization(&self) -> Result<StableOscillatorToken, Infallible>
pub fn await_stabilization(&self) -> Result<StableOscillatorToken, Infallible>
One has to wait for the startup delay before using the oscillator, ie awaiting stabilization of the XOSC
sourcepub fn get_stable(
self,
_token: StableOscillatorToken
) -> CrystalOscillator<Stable>
pub fn get_stable( self, _token: StableOscillatorToken ) -> CrystalOscillator<Stable>
Returns the stabilized oscillator
source§impl CrystalOscillator<Stable>
impl CrystalOscillator<Stable>
sourcepub fn operating_frequency(&self) -> HertzU32
pub fn operating_frequency(&self) -> HertzU32
Operating frequency of the XOSC in hertz
sourcepub fn disable(self) -> CrystalOscillator<Disabled>
pub fn disable(self) -> CrystalOscillator<Disabled>
Disables the XOSC
sourcepub unsafe fn dormant(self) -> CrystalOscillator<Unstable>
pub unsafe fn dormant(self) -> CrystalOscillator<Unstable>
Put the XOSC in DORMANT state. The method returns after the processor awakens.
After waking up from the DORMANT state, XOSC needs to re-stabilise.
§Safety
This method is marked unsafe because prior to switch the XOSC into DORMANT state, PLLs must be stopped and IRQs have to be properly configured. This method does not do any of that, it merely switches the XOSC to DORMANT state. It should only be called if this oscillator is the clock source for the system clock. See Chapter 2, Section 16, §5) for details.
Trait Implementations§
source§impl ClockSource for CrystalOscillator<Stable>
impl ClockSource for CrystalOscillator<Stable>
source§impl ValidSrc<GpioOutput0Clock> for CrystalOscillator<Stable>
impl ValidSrc<GpioOutput0Clock> for CrystalOscillator<Stable>
source§impl ValidSrc<GpioOutput1Clock> for CrystalOscillator<Stable>
impl ValidSrc<GpioOutput1Clock> for CrystalOscillator<Stable>
source§impl ValidSrc<GpioOutput2Clock> for CrystalOscillator<Stable>
impl ValidSrc<GpioOutput2Clock> for CrystalOscillator<Stable>
source§impl ValidSrc<GpioOutput3Clock> for CrystalOscillator<Stable>
impl ValidSrc<GpioOutput3Clock> for CrystalOscillator<Stable>
source§impl ValidSrc<PeripheralClock> for CrystalOscillator<Stable>
impl ValidSrc<PeripheralClock> for CrystalOscillator<Stable>
source§impl ValidSrc<ReferenceClock> for CrystalOscillator<Stable>
impl ValidSrc<ReferenceClock> for CrystalOscillator<Stable>
source§impl ValidSrc<SystemClock> for CrystalOscillator<Stable>
impl ValidSrc<SystemClock> for CrystalOscillator<Stable>
Auto Trait Implementations§
impl<S> Freeze for CrystalOscillator<S>where
S: Freeze,
impl<S> RefUnwindSafe for CrystalOscillator<S>where
S: RefUnwindSafe,
impl<S> Send for CrystalOscillator<S>where
S: Send,
impl<S> !Sync for CrystalOscillator<S>
impl<S> Unpin for CrystalOscillator<S>where
S: Unpin,
impl<S> UnwindSafe for CrystalOscillator<S>where
S: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more