Skip to main content

Refclock

Struct Refclock 

Source
pub struct Refclock { /* private fields */ }
Expand description

Reference clock generator singleton

Implementations§

Source§

impl Refclock

Source

pub fn enable(&self)

Enable reference clock generator

Source

pub fn disable(&self)

Disable reference clock generator

Source

pub fn output_enable(&self)

Enable clock output

Source

pub fn output_disable(&self)

Disable clock output

Source

pub fn select_source(&self, s: Source) -> Result<(), Error>

Select a clock source

Returns an InvalidState error if called when active. Call this before enable() or after disable()

Source

pub fn set_divisor(&self, div_q8: u32) -> Result<(), Error>

Set reference clock divisor

div_q8 is the fractional clock divisor in Q16.8 representation. The minimum value is 2 (represented as 0x000200). The maximum value is 2^16 - 1/(2^8) (represented as 0xffffff). div_q8 refers to the total clock ratio including an additional /2 division described in the data sheet. Returns an InvalidArgument error if the divisor is out of range and an InvalidState error if called during an ongoing divisor change operation.

Remark: not clear (to me) from the documentation if changing the integer part of the divisor works when the reference clock module is active; needs to be tested.

Source

pub fn set_divisor_ongoing(&self) -> bool

Check if a clock divisor setting operation is ongoing.

Returns false if the ACTIVE bit is not set regardless of whether a divisor setting has previously been initiated.

Auto Trait Implementations§

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>,

Source§

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>,

Source§

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.