Struct atsamd_hal::rtc::TimerParams
source · [−]pub struct TimerParams {
pub divider: PRESCALER_A,
pub cycles: u32,
}
Expand description
Helper type for computing cycles and divider given frequency
Fields
divider: PRESCALER_A
cycles: u32
Implementations
sourceimpl TimerParams
impl TimerParams
sourcepub fn new<T>(timeout: T, src_freq: u32) -> Self where
T: Into<Hertz>,
pub fn new<T>(timeout: T, src_freq: u32) -> Self where
T: Into<Hertz>,
calculates RTC timer paramters based on the input frequency-based timeout.
sourcepub fn new_us<T>(timeout: T, src_freq: u32) -> Self where
T: Into<Nanoseconds>,
pub fn new_us<T>(timeout: T, src_freq: u32) -> Self where
T: Into<Nanoseconds>,
calculates RTC timer paramters based on the input period-based timeout.
Trait Implementations
sourceimpl Clone for TimerParams
impl Clone for TimerParams
sourcefn clone(&self) -> TimerParams
fn clone(&self) -> TimerParams
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TimerParams
impl Debug for TimerParams
impl Copy for TimerParams
Auto Trait Implementations
impl RefUnwindSafe for TimerParams
impl Send for TimerParams
impl Sync for TimerParams
impl Unpin for TimerParams
impl UnwindSafe for TimerParams
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more