[][src]Struct embedded_spi::wrapper::Wrapper

pub struct Wrapper<Spi, SpiError, Pin, PinError> { /* fields omitted */ }

Wrapper wraps an Spi and Pin object to support transactions

Methods

impl<Spi, SpiError, Pin, PinError> Wrapper<Spi, SpiError, Pin, PinError> where
    Spi: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>,
    Pin: OutputPin<Error = PinError>, 
[src]

pub fn new(spi: Spi, cs: Pin) -> Self[src]

pub fn check_error(&mut self) -> Result<(), Error<SpiError, PinError>>[src]

Check the internal error state of the peripheral This provides a mechanism to retrieve the rust error if an error occurs during an FFI call, and clears the internal error state

impl<Spi, SpiError, Pin, PinError> Wrapper<Spi, SpiError, Pin, PinError> where
    Spi: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>,
    Pin: OutputPin<Error = PinError>, 
[src]

pub fn to_c_ptr(&mut self) -> *mut c_void[src]

Generate a C void pointer that can be re-cast into this object

pub extern "C" fn spi_write(
    ctx: *mut c_void,
    prefix: *mut u8,
    prefix_len: u16,
    data: *mut u8,
    data_len: u16
) -> isize
[src]

C FFI compatible spi_write function for dependency injection

pub extern "C" fn spi_read(
    ctx: *mut c_void,
    prefix: *mut u8,
    prefix_len: u16,
    data: *mut u8,
    data_len: u16
) -> isize
[src]

C FFI compatible spi_read function for dependency injection

Trait Implementations

impl<Spi: PartialEq, SpiError: PartialEq, Pin: PartialEq, PinError: PartialEq> PartialEq<Wrapper<Spi, SpiError, Pin, PinError>> for Wrapper<Spi, SpiError, Pin, PinError>[src]

impl<Spi: Debug, SpiError: Debug, Pin: Debug, PinError: Debug> Debug for Wrapper<Spi, SpiError, Pin, PinError>[src]

impl<Spi: Clone, SpiError: Clone, Pin: Clone, PinError: Clone> Clone for Wrapper<Spi, SpiError, Pin, PinError>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<Spi, SpiError, Pin, PinError> Send for Wrapper<Spi, SpiError, Pin, PinError> where
    Pin: Send,
    PinError: Send,
    Spi: Send,
    SpiError: Send

impl<Spi, SpiError, Pin, PinError> Sync for Wrapper<Spi, SpiError, Pin, PinError> where
    Pin: Sync,
    PinError: Sync,
    Spi: Sync,
    SpiError: Sync

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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.

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.