[][src]Struct ads129xx::spi::SpiDevice

pub struct SpiDevice<SPI, NCS, TIM> { /* fields omitted */ }

A SPI device also triggering the nCS-pin when suited.

Methods

impl<SPI, NCS, TIM, E, EO> SpiDevice<SPI, NCS, TIM> where
    SPI: Write<u8, Error = E> + Transfer<u8, Error = E>,
    NCS: OutputPin<Error = EO>,
    TIM: CountDown
[src]

pub fn new(spi: SPI, ncs: NCS, timer: TIM) -> Result<Self, SpiError<E, EO>>[src]

Create a new SPI device

pub fn transfer(&mut self, buffer: &mut [u8]) -> Result<(), SpiError<E, EO>>[src]

Transfer the buffer to the device, the passed buffer will contain the read data.

pub fn write(&mut self, buffer: &[u8]) -> Result<(), SpiError<E, EO>>[src]

Write a number of bytes to the device.

pub fn wait(&mut self, i: u16) -> Result<(), SpiError<E, EO>>[src]

pub fn into_inner(self) -> (SPI, NCS, TIM)[src]

Consume self and release inner resources.

Auto Trait Implementations

impl<SPI, NCS, TIM> Unpin for SpiDevice<SPI, NCS, TIM> where
    NCS: Unpin,
    SPI: Unpin,
    TIM: Unpin

impl<SPI, NCS, TIM> Send for SpiDevice<SPI, NCS, TIM> where
    NCS: Send,
    SPI: Send,
    TIM: Send

impl<SPI, NCS, TIM> Sync for SpiDevice<SPI, NCS, TIM> where
    NCS: Sync,
    SPI: Sync,
    TIM: Sync

Blanket Implementations

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