Struct stm32f412g::clocks::pll::Pll

source ·
pub struct Pll<'a, PllConstants> { /* private fields */ }
Expand description

Main PLL clock structure.

Implementations§

source§

impl<'a, PllConstants> Pll<'a, PllConstants>
where PllConstants: PllConstants,

source

pub fn enable(&self) -> Result<(), ErrorCode>

Start the PLL clock.

§Errors
  • Err(ErrorCode::BUSY): if enabling the PLL clock took too long. Recall this method to ensure the PLL clock is running.
source

pub fn disable(&self) -> Result<(), ErrorCode>

Stop the PLL clock.

§Errors
source

pub fn is_enabled(&self) -> bool

Check whether the PLL clock is enabled or not.

§Returns
  • false: the PLL clock is not enabled
  • true: the PLL clock is enabled
source

pub fn get_frequency_mhz(&self) -> Option<usize>

Get the frequency in MHz of the PLL clock.

§Returns
  • Some(frequency_mhz): if the PLL clock is enabled.
  • None: if the PLL clock is disabled.
source

pub fn get_frequency_mhz_no_cache( &self, source_frequency: usize, ) -> Option<usize>

Get the frequency in MHz of the PLL clock from RCC registers instead of using the cached value.

§Returns
  • Some(frequency_mhz): if the PLL clock is enabled.
  • None: if the PLL clock is disabled.
source

pub fn get_frequency_mhz_pll48(&self) -> Option<usize>

Get the frequency in MHz of the PLL48 clock.

NOTE: If the PLL clock was not configured with a frequency multiple of 48MHz, the returned value is inaccurate.

§Returns
  • Some(frequency_mhz): if the PLL clock is enabled.
  • None: if the PLL clock is disabled.
source

pub fn is_pll48_calibrated(&self) -> bool

Check if the PLL48 clock is calibrated (its output is exactly 48MHz).

A frequency of 48MHz is required for USB OTG FS.

§Returns
  • true: the PLL48 clock frequency is exactly 48MHz.
  • false: the PLL48 clock is not exactly 48MHz.

Auto Trait Implementations§

§

impl<'a, PllConstants> !Freeze for Pll<'a, PllConstants>

§

impl<'a, PllConstants> !RefUnwindSafe for Pll<'a, PllConstants>

§

impl<'a, PllConstants> !Send for Pll<'a, PllConstants>

§

impl<'a, PllConstants> !Sync for Pll<'a, PllConstants>

§

impl<'a, PllConstants> Unpin for Pll<'a, PllConstants>
where PllConstants: Unpin,

§

impl<'a, PllConstants> !UnwindSafe for Pll<'a, PllConstants>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.