#ftdi #usb #io #hal

ftd2xx-embedded-hal

embedded-hal implementation for FTDI USB devices

8 releases (breaking)

0.7.0 Apr 18, 2021
0.6.0 Apr 10, 2021
0.5.1 Mar 21, 2021
0.4.0 Mar 5, 2021
0.1.0 Sep 12, 2020

#82 in Embedded development

Download history 3/week @ 2021-01-16 3/week @ 2021-01-23 1/week @ 2021-01-30 3/week @ 2021-02-06 74/week @ 2021-02-13 3/week @ 2021-02-20 10/week @ 2021-02-27 18/week @ 2021-03-06 5/week @ 2021-03-13 66/week @ 2021-03-20 23/week @ 2021-03-27 15/week @ 2021-04-03 44/week @ 2021-04-10 43/week @ 2021-04-17 14/week @ 2021-04-24 19/week @ 2021-05-01

89 downloads per month
Used in eeprom25aa02e48

MIT license

51KB
808 lines

Maintenance crates.io docs.rs Build Status

ftd2xx-embedded-hal

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.

One-time Setup

Detailed setup instructions can be found in the libftd2xx crate.

Linux Quickstart

Use static linking (enable the "static" feature flag), and add udev rules.

[dependencies.ftd2xx-embedded-hal]
version = "~0.7.0"
features = ["static"]

Windows Quickstart

Use dyanmic linking (no feature flags), and run the vendor setup executable to install the vendor library on your system.

[dependencies.ftd2xx-embedded-hal]
version = "~0.7.0"

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.

Dependencies

~2.5MB
~39K SLoC