Struct SwitchPin
pub struct SwitchPin { /* private fields */ }Expand description
The combination of an Input and an active Level.
If the "external-interrupts" feature is enabled
then inner input supports interrupts and SwitchPin
implements the wait_for_X methods.
Implementations§
§impl SwitchPin
impl SwitchPin
pub fn new(input: IntEnabledInput<'static>, active: Level) -> SwitchPin
Available on crate feature external-interrupts only.
pub fn new(input: IntEnabledInput<'static>, active: Level) -> SwitchPin
external-interrupts only.Returns a configured SwitchPin.
pub fn is_inactive(&self) -> bool
pub fn is_inactive(&self) -> bool
Returns whether the pin is inactive.
§impl SwitchPin
impl SwitchPin
pub async fn wait_for_active(&mut self)
Available on crate feature external-interrupts only.
pub async fn wait_for_active(&mut self)
external-interrupts only.Asynchronously wait for the pin to be active. Returns immediately if the pin is active.
pub async fn wait_for_inactive(&mut self)
Available on crate feature external-interrupts only.
pub async fn wait_for_inactive(&mut self)
external-interrupts only.Asynchronously wait for the pin to be inactive. Returns immediately if the pin is inactive.
pub async fn wait_for_activation_edge(&mut self)
Available on crate feature external-interrupts only.
pub async fn wait_for_activation_edge(&mut self)
external-interrupts only.Asynchronously waits for the input level to transition from inactive to active.
pub async fn wait_for_deactivation_edge(&mut self)
Available on crate feature external-interrupts only.
pub async fn wait_for_deactivation_edge(&mut self)
external-interrupts only.Asynchronously waits for the input level to transition from active to inactive.
Auto Trait Implementations§
impl Freeze for SwitchPin
impl RefUnwindSafe for SwitchPin
impl Send for SwitchPin
impl Sync for SwitchPin
impl Unpin for SwitchPin
impl UnsafeUnpin for SwitchPin
impl UnwindSafe for SwitchPin
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