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

pub struct AtomicPinState { /* fields omitted */ }

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.