[][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> SpiDevice<SPI, NCS, TIM> where
    SPI: Write<u8, Error = E> + Transfer<u8, Error = E>,
    NCS: OutputPin<Error = Infallible>,
    TIM: CountDown
[src]

pub fn new(spi: SPI, ncs: NCS, timer: TIM) -> Self[src]

Create a new SPI device

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

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

pub unsafe fn unsafe_transfer(&mut self, buffer: &mut [u8]) -> Result<(), E>[src]

Transfer the buffer to the device, the passed buffer will contain the read data. WARNING: This function runs spi transfers more power efficiently by avoiding the delays that are usually necessary when communicating with the ADS1292 device. Use a delay of at least 50 microseconds between uses of this and other spi transfer and write functions.

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

Write a number of bytes to the device.

pub fn wait(&mut self, i: u16)[src]

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

Consume self and release inner resources.

Auto Trait Implementations

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

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

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.