Struct ftdi_embedded_hal::Spi

source ·
pub struct Spi<Device: MpsseCmdExecutor> { /* private fields */ }
Expand description

FTDI SPI bus.

In embedded-hal version 1 this represents an exclusive SPI bus.

This is created by calling FtHal::spi.

Implementations§

Set the SPI clock polarity.

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

Example
use eh1::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);

Trait Implementations§

Formats the value using the given formatter. Read more
Error type
An enumeration of SPI errors
Reads the word stored in the shift register Read more
Sends a word to the slave
Reads the word stored in the shift register Read more
Writes a word to the slave
Write and read simultaneously. The contents of words are written to the slave, and the received words are stored into the same words buffer, overwriting it. Read more
Write and read simultaneously. write is written to the slave on MOSI and words received on MISO are stored in read. Read more
Wait until all operations have completed and the bus is idle. Read more
Read words from the slave. Read more
Write words to the slave, ignoring all the incoming words Read more
Error type
Sends words to the slave. Returns the words received from the slave
Error type
Sends words to the slave, ignoring all the incoming words

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.