Crate ftd2xx_embedded_hal

Crate ftd2xx_embedded_hal 

Source
Expand description

Inspired by ftdi-embedded-hal this is an embedded-hal implementation for the for the FTDI chips using the libftd2xx drivers.

This enables development of embedded device drivers without the use of a microcontroller. The FTDI D2xx devices interface with your PC via USB, and provide a multi-protocol synchronous serial engine to interface with most UART, SPI, and I2C embedded devices.

Note: This is strictly a development tool. The crate contains runtime borrow checks and explicit panics to adapt the FTDI device into the embedded-hal traits.

§Quickstart

  • Enable the “static” feature flag to use static linking.
  • Linux users only: Add udev rules.
[dependencies.ftd2xx-embedded-hal]
version = "~0.9.1"
features = ["static"]

§Examples

§SPI

use embedded_hal::prelude::*;
use ftd2xx_embedded_hal::Ft232hHal;

let ftdi = Ft232hHal::new()?.init_default()?;
let mut spi = ftdi.spi()?;

§I2C

use embedded_hal::prelude::*;
use ftd2xx_embedded_hal::Ft232hHal;

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

§GPIO

use embedded_hal::prelude::*;
use ftd2xx_embedded_hal::Ft232hHal;

let ftdi = Ft232hHal::new()?.init_default()?;
let mut gpio = ftdi.ad6();

§Limitations

  • Limited trait support: SPI, I2C, Delay, and OutputPin traits are implemented.
  • Limited device support: FT232H, FT2232H, FT4232H.

Re-exports§

pub use embedded_hal;
pub use libftd2xx;

Structs§

Delay
Delay structure.
FtHal
FTxxx device.
I2c
FTDI I2C interface.
Initialized
Type state for an initialized FTDI HAL.
OutputPin
FTDI output pin.
Spi
FTDI SPI interface.
Uninitialized
Type state for an uninitialized FTDI HAL.

Enums§

I2cError
Error returned from I2C methods.

Type Aliases§

Ft232hHal
FT232H device.
Ft2232hHal
FT2232H device.
Ft4232hHal
FT4232H device.