Struct avr_oxide::devices::debouncer::Debouncer

source ·
pub struct Debouncer { /* private fields */ }

Trait Implementations§

source§

impl Into<OwnOrBorrow<'static, dyn Pin>> for Debouncer

source§

fn into(self) -> OwnOrBorrow<'static, dyn Pin>

Converts this type into the (usually inferred) input type.
source§

impl Pin for Debouncer

source§

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)

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_mode(&self, mode: PinMode)

Set the input/output mode for this pin
source§

fn toggle(&self)

Toggle this pin’s output level
source§

fn set_high(&self)

Set the pin’s output to high
source§

fn set_low(&self)

Set the pin’s output to low
source§

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)

Set when this pin will generate interrupts
source§

impl UsesPin for Debouncer

source§

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) -> Self
where 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 Self
where 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 Self
where 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§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.