pub struct TimerParams {
pub divider: u16,
pub cycles: u32,
}
Expand description
Helper type for computing cycles and divider given frequency
Fields§
§divider: u16
§cycles: u32
Implementations§
Source§impl TimerParams
impl TimerParams
Sourcepub fn new(timeout: Hertz, src_freq: Hertz) -> Self
pub fn new(timeout: Hertz, src_freq: Hertz) -> Self
Calculates the TimerParams
from a given frequency based timeout.
Panics if the combination of timeout
and src_freq
cannot be done
with a 16-bit timer.
Sourcepub fn new_ns(timeout: Nanoseconds, src_freq: Hertz) -> Self
pub fn new_ns(timeout: Nanoseconds, src_freq: Hertz) -> Self
Calculates the TimerParams
from a given period based timeout.
Panics if the combination of timeout
and src_freq
cannot be done
with a 16-bit timer.
Trait Implementations§
Source§impl Clone for TimerParams
impl Clone for TimerParams
Source§fn clone(&self) -> TimerParams
fn clone(&self) -> TimerParams
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TimerParams
impl Debug for TimerParams
impl Copy for TimerParams
Auto Trait Implementations§
impl Freeze for TimerParams
impl RefUnwindSafe for TimerParams
impl Send for TimerParams
impl Sync for TimerParams
impl Unpin for TimerParams
impl UnwindSafe for TimerParams
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
Mutably borrows from an owned value. Read more