Struct ftdi_embedded_hal::Spi
source · [−]pub struct Spi<'a, Device: MpsseCmdExecutor> { /* private fields */ }
Expand description
FTDI SPI interface.
This is created by calling FtHal::spi
.
Implementations
impl<'a, Device, E> Spi<'a, Device> where
Device: MpsseCmdExecutor<Error = E>,
E: Error,
Error<E>: From<E>,
impl<'a, Device, E> Spi<'a, Device> where
Device: MpsseCmdExecutor<Error = E>,
E: Error,
Error<E>: From<E>,
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 ftdi_embedded_hal as hal;
let device = libftd2xx::Ft2232h::with_description("Dual RS232-HS A")?;
let hal = hal::FtHal::init_freq(device, 3_000_000)?;
let mut spi = hal.spi()?;
spi.set_clock_polarity(Polarity::IdleLow);