Struct ftd2xx_embedded_hal::Spi[][src]

pub struct Spi<'a, Device> { /* fields omitted */ }

FTDI SPI interface.

This is created by calling FtHal::spi.

Implementations

impl<'a, Device: FtdiCommon> Spi<'a, Device>[src]

pub fn set_clock_polarity(&mut self, cpol: Polarity)[src]

Set the SPI clock polarity.

FTD2XX devices only supports SPI mode 0 and 2, clock phase is fixed.

Example

use embedded_hal::spi::Polarity;
use ftd2xx_embedded_hal as hal;

let ftdi = hal::Ft232hHal::new()?.init_default()?;
let mut spi = ftdi.spi()?;
spi.set_clock_polarity(Polarity::IdleLow);

Trait Implementations

impl<'a, Device: Debug> Debug for Spi<'a, Device>[src]

impl<'a, Device: FtdiCommon> FullDuplex<u8> for Spi<'a, Device>[src]

type Error = TimeoutError

An enumeration of SPI errors

impl<'a, Device: FtdiCommon> Transfer<u8> for Spi<'a, Device>[src]

type Error = TimeoutError

Error type

impl<'a, Device: FtdiCommon> Write<u8> for Spi<'a, Device>[src]

type Error = TimeoutError

Error type

Auto Trait Implementations

impl<'a, Device> RefUnwindSafe for Spi<'a, Device>

impl<'a, Device> Send for Spi<'a, Device> where
    Device: Send

impl<'a, Device> Sync for Spi<'a, Device> where
    Device: Send

impl<'a, Device> Unpin for Spi<'a, Device>

impl<'a, Device> UnwindSafe for Spi<'a, Device>

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.