[][src]Struct bl602_hal::clock::Strict

pub struct Strict { /* fields omitted */ }

Strict clock configurator

This configurator only accepts strictly accurate value. If all available frequency values after configurated does not strictly equal to the desired value, the freeze function panics. Users must be careful to ensure that the output frequency values can be strictly configurated into using input frequency values and internal clock frequencies.

If you need to get most precise frequenct possible (other than the stictly accutare value only), use configurator Precise instead.

For example if 49.60MHz and 50.20MHz are able to be configurated prefectly, input 50MHz into Strict would result in a panic when performing freeze; however input same 50MHz into Precise it would not panic, but would set and freeze into 50.20MHz as the frequency error is smallest.

Implementations

impl Strict[src]

pub fn new() -> Self[src]

Create a strict configurator

pub fn uart_clk(self, freq: impl Into<Hertz>) -> Self[src]

Sets the desired frequency for the UART-CLK clock

pub fn freeze(self, clk_cfg: &mut ClkCfg) -> Clocks[src]

Calculate and balance clock registers to configure into the given clock value. If accurate value is not possible, this function panics.

Be aware that Rust's panic is sometimes not obvious on embedded devices; if your program didn't execute as expected, or the pc is pointing to somewhere weird (usually abort: j abort), it's likely that this function have panicked. Breakpoint on rust_begin_unwind may help debugging.

Panics

If strictly accurate value of given ck_sys etc. is not reachable, this function panics.

Auto Trait Implementations

impl Send for Strict

impl Sync for Strict

impl Unpin for Strict

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.