Struct ftd2xx_embedded_hal::I2c[][src]

pub struct I2c<'a, Device: FtdiCommon> { /* fields omitted */ }
Expand description

FTDI I2C interface.

This is created by calling FtHal::i2c.

Implementations

Set the length of start and stop conditions.

This is an advanced feature that most people will not need to touch. I2C start and stop conditions are generated with a number of MPSSE commands. This sets the number of MPSSE command generated for each stop and start condition. An increase in the number of MPSSE commands roughtly correlates to an increase in the duration.

Example

use ftd2xx_embedded_hal as hal;

let ftdi = hal::Ft232hHal::new()?.init_default()?;
let mut i2c = ftdi.i2c()?;
i2c.set_stop_start_len(10);

Enable faster I2C transactions by sending commands in a single write.

This is disabled by default.

Normally the I2C methods will send commands with a delay after each slave ACK to read from the USB device. Enabling this will send I2C commands without a delay, but slave ACKs will only be checked at the end of each call to read, write, or write_read.

Example

use ftd2xx_embedded_hal as hal;

let ftdi = hal::Ft232hHal::new()?.init_default()?;
let mut i2c = ftdi.i2c()?;
i2c.set_fast(true);

Trait Implementations

Formats the value using the given formatter. Read more

Error type

Reads enough bytes from slave with address to fill buffer Read more

Error type

Writes bytes to slave with address address Read more

Error type

Writes bytes to slave with address address and then reads enough bytes to fill buffer in a single transaction Read more

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

Performs the conversion.

Performs the conversion.

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.