[−][src]Struct embedded_hal_sync_pins::pins::AtomicPinState
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
impl AtomicPinState
[src]
pub fn new() -> Self
[src]
Creates a new atomic pin state with a floating state.
pub fn new_with_state(state: PinState) -> Self
[src]
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);
pub fn load(&self, order: Ordering) -> PinState
[src]
Loads a state from the atomic pin state.
load
taks an Ordering
argument which describes the memory
ordering of this operation. For more information see AtomicUsize::load
.
pub fn store(&self, state: PinState, order: Ordering)
[src]
Stores a state into the atomic pin state.
store
taks an Ordering
argument which describes the memory
ordering of this operation. For more information see AtomicUsize::store
.
Trait Implementations
impl Debug for AtomicPinState
[src]
impl Default for AtomicPinState
[src]
Auto Trait Implementations
impl RefUnwindSafe for AtomicPinState
[src]
impl Send for AtomicPinState
[src]
impl Sync for AtomicPinState
[src]
impl Unpin for AtomicPinState
[src]
impl UnwindSafe for AtomicPinState
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,