pub struct PinSwitch<P: InputPin, S: PressedState, C: Clock> { /* private fields */ }
Expand description
Switch implementation for InputPin
of embedded_hal
Implementations§
Trait Implementations§
Source§impl<P: InputPin, S: PressedState, C: Clock> Switch<C> for PinSwitch<P, S, C>
impl<P: InputPin, S: PressedState, C: Clock> Switch<C> for PinSwitch<P, S, C>
Source§fn has_changed(&self) -> bool
fn has_changed(&self) -> bool
Indicates that the switch state has has_changed since the last poll
Source§fn is_pressed(&self) -> bool
fn is_pressed(&self) -> bool
Indicates that the switch is in pressed state
Source§fn is_released(&self) -> bool
fn is_released(&self) -> bool
Indicates that the switch is in released state
Source§fn pressed_for(&self) -> Option<Milliseconds<C::T>>
fn pressed_for(&self) -> Option<Milliseconds<C::T>>
Returns the duration for which the switch has been pressed for Read more
Source§fn released_for(&self) -> Option<Milliseconds<C::T>>
fn released_for(&self) -> Option<Milliseconds<C::T>>
Returns the duration for which the switch has been released for Read more
Source§fn prev_state_lasted_for(&self) -> Milliseconds<<C as Clock>::T>
fn prev_state_lasted_for(&self) -> Milliseconds<<C as Clock>::T>
Returns the duration for which the last switch state lasted for
Source§fn current_state(&self, now: Instant<C>) -> Milliseconds<<C as Clock>::T>
fn current_state(&self, now: Instant<C>) -> Milliseconds<<C as Clock>::T>
Returns the duration for which the current state is held Read more
Auto Trait Implementations§
impl<P, S, C> Freeze for PinSwitch<P, S, C>
impl<P, S, C> RefUnwindSafe for PinSwitch<P, S, C>
impl<P, S, C> Send for PinSwitch<P, S, C>
impl<P, S, C> Sync for PinSwitch<P, S, C>
impl<P, S, C> Unpin for PinSwitch<P, S, C>
impl<P, S, C> UnwindSafe for PinSwitch<P, S, C>
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