pub struct Debouncer { /* private fields */ }
Trait Implementations§
source§impl Into<OwnOrBorrow<'static, dyn Pin>> for Debouncer
impl Into<OwnOrBorrow<'static, dyn Pin>> for Debouncer
source§fn into(self) -> OwnOrBorrow<'static, dyn Pin>
fn into(self) -> OwnOrBorrow<'static, dyn Pin>
Converts this type into the (usually inferred) input type.
source§impl Pin for Debouncer
impl Pin for Debouncer
source§fn get(&self) -> bool
fn get(&self) -> bool
Gets the pin state. Reads multiple samples and only returns once the pin has reached a steady state.
source§fn listen(&'static self, handler: PinIsrCallback)
fn listen(&'static self, handler: PinIsrCallback)
Listen for interrupts, calling the given callback once we receive one. We will filter out unwanted (‘bounce’) interrupts by waiting for the underlying pin to become stable and then determining whether or not the callback should be called.
source§fn set(&self, high: bool)
fn set(&self, high: bool)
Set the pin’s output according to the boolean (true == high, false == low)
source§fn set_interrupt_mode(&self, mode: InterruptMode)
fn set_interrupt_mode(&self, mode: InterruptMode)
Set when this pin will generate interrupts
source§impl UsesPin for Debouncer
impl UsesPin for Debouncer
source§fn using<OP: Into<OwnOrBorrow<'static, dyn Pin>>>(pin: OP) -> Self
fn using<OP: Into<OwnOrBorrow<'static, dyn Pin>>>(pin: OP) -> Self
Create a Debouncer which will wrap the given underlying Pin instance to provide a debounced version of it.
source§fn with_pin(pin: &'static dyn Pin) -> Selfwhere
Self: Sized,
fn with_pin(pin: &'static dyn Pin) -> Selfwhere
Self: Sized,
Convenience method to create an instance of this device with a
given static reference to a pin (avoids a certain amount of type
hinting boilerplate for the caller.)
source§fn static_using<OP: Into<OwnOrBorrow<'static, dyn Pin>>>(
pin: OP
) -> &'static mut Selfwhere
Self: Sized,
fn static_using<OP: Into<OwnOrBorrow<'static, dyn Pin>>>(
pin: OP
) -> &'static mut Selfwhere
Self: Sized,
Create an instance of this device that uses the given instance of a pin,
and return a static reference good for the lifetime of the program. Read more
source§fn static_with_pin(pin: &'static dyn Pin) -> &'static mut Selfwhere
Self: Sized,
fn static_with_pin(pin: &'static dyn Pin) -> &'static mut Selfwhere
Self: Sized,
Create an instance of this device that uses the given reference to a pin,
and return a static reference good for the lifetime of the program. Read more
Auto Trait Implementations§
impl !Freeze for Debouncer
impl !RefUnwindSafe for Debouncer
impl !Send for Debouncer
impl !Sync for Debouncer
impl Unpin for Debouncer
impl !UnwindSafe for Debouncer
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