Struct embedded_hal_sync_pins::pins::AtomicPinState[][src]

pub struct AtomicPinState { /* fields omitted */ }
Expand description

A digital pin state which can be safely shared between threads.

This type is based on AtomicUsize, so the same limitations and platform support apply.

Implementations

Creates a new atomic pin state with a floating state.

Creates a new atomic pin state with a given state.

Examples
use embedded_hal_sync_pins::pins::{PinState, AtomicPinState};

let high = AtomicPinState::new_with_state(PinState::High);
let low = AtomicPinState::new_with_state(PinState::Low);

Loads a state from the atomic pin state.

load takes an Ordering argument which describes the memory ordering of this operation. For more information see AtomicUsize::load.

Stores a state into the atomic pin state.

store takes an Ordering argument which describes the memory ordering of this operation. For more information see AtomicUsize::store.

Updates the state of this atomic pin state based on a stored value.

toggle takes an Ordering argument which describes the memory ordering of this operation. For more information see AtomicUsize::store.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.