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 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.
