pub struct Refclock { /* private fields */ }Expand description
Reference clock generator singleton
Implementations§
Source§impl Refclock
impl Refclock
Sourcepub fn output_enable(&self)
pub fn output_enable(&self)
Enable clock output
Sourcepub fn output_disable(&self)
pub fn output_disable(&self)
Disable clock output
Sourcepub fn select_source(&self, s: Source) -> Result<(), Error>
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()
Sourcepub fn set_divisor(&self, div_q8: u32) -> Result<(), Error>
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.
Sourcepub fn set_divisor_ongoing(&self) -> bool
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.