[−][src]Struct embedded_spi::wrapper::Wrapper
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]
Spi: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>,
Pin: OutputPin<Error = PinError>,
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]
Spi: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>,
Pin: OutputPin<Error = PinError>,
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]
ctx: *mut c_void,
prefix: *mut u8,
prefix_len: u16,
data: *mut u8,
data_len: u16
) -> isize
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]
ctx: *mut c_void,
prefix: *mut u8,
prefix_len: u16,
data: *mut u8,
data_len: u16
) -> isize
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]
fn eq(&self, other: &Wrapper<Spi, SpiError, Pin, PinError>) -> bool
[src]
fn ne(&self, other: &Wrapper<Spi, SpiError, Pin, PinError>) -> bool
[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]
Auto Trait Implementations
impl<Spi, SpiError, Pin, PinError> Send for Wrapper<Spi, SpiError, Pin, PinError> where
Pin: Send,
PinError: Send,
Spi: Send,
SpiError: Send,
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,
Pin: Sync,
PinError: Sync,
Spi: Sync,
SpiError: Sync,
Blanket Implementations
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.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,