pub struct HallInterface<'d, T: GeneralInstance4Channel> { /* private fields */ }Expand description
Hall sensor timer interface.
Implementations§
Source§impl<'d, T: GeneralInstance4Channel> HallInterface<'d, T>
impl<'d, T: GeneralInstance4Channel> HallInterface<'d, T>
Sourcepub fn new(
tim: Peri<'d, T>,
ch1: Peri<'d, impl TimerPin<T, Ch1>>,
ch2: Peri<'d, impl TimerPin<T, Ch2>>,
ch3: Peri<'d, impl TimerPin<T, Ch3>>,
config: HallConfig,
) -> Self
pub fn new( tim: Peri<'d, T>, ch1: Peri<'d, impl TimerPin<T, Ch1>>, ch2: Peri<'d, impl TimerPin<T, Ch2>>, ch3: Peri<'d, impl TimerPin<T, Ch3>>, config: HallConfig, ) -> Self
Create and configure a Hall sensor interface on timer CH1/CH2/CH3.
Sourcepub fn capture_ticks(&self) -> T::Word
pub fn capture_ticks(&self) -> T::Word
Read the latest captured Hall event timestamp (CCR1).
Sourcepub fn event_pending(&self) -> bool
pub fn event_pending(&self) -> bool
Check capture interrupt flag for Hall event channel.
Sourcepub fn clear_event(&self)
pub fn clear_event(&self)
Clear capture interrupt flag for Hall event channel.
Auto Trait Implementations§
impl<'d, T> Freeze for HallInterface<'d, T>where
T: Freeze,
impl<'d, T> RefUnwindSafe for HallInterface<'d, T>where
T: RefUnwindSafe,
impl<'d, T> Send for HallInterface<'d, T>where
T: Send,
impl<'d, T> Sync for HallInterface<'d, T>where
T: Sync,
impl<'d, T> Unpin for HallInterface<'d, T>where
T: Unpin,
impl<'d, T> !UnwindSafe for HallInterface<'d, T>
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
Source§impl<T> ToMutAligned for Twhere
T: ?Sized,
impl<T> ToMutAligned for Twhere
T: ?Sized,
Source§fn to_mut_aligned<A>(&mut self) -> &mut Aligned<A, <T as ToMutAligned>::Element>where
A: Alignment,
fn to_mut_aligned<A>(&mut self) -> &mut Aligned<A, <T as ToMutAligned>::Element>where
A: Alignment,
Create a type-checked aligned value from a value that is aligned.