[][src]Crate libftd2xx

Rust safe wrapper for the FTDI D2XX drivers.

This takes the libftd2xx-ffi C bindings crate and extends it with rust safe wrappers.

Usage

Simply add this crate as a dependency in your Cargo.toml. The static library is distributed in the libftd2xx-ffi crate with permission from FTDI.

[dependencies]
libftd2xx = "~0.8.0"

This is a basic example to get your started. Check the source code or documentation for more examples.

use libftd2xx::{Ftdi, FtdiCommon};

let mut ft = Ftdi::new()?;
let info = ft.device_info()?;
println!("Device information: {:?}", info);

References

Troubleshooting

Unknown Device on Linux

Remove the VCP FTDI driver.

sudo rmmod ftdi_sio
sudo rmmod usbserial

See FTDI Drivers Installation Guide for Linux for more details.

Maintainers Notes

README Generation

The README file is generated with cargo-readme.

cargo install cargo-readme
cargo readme > README.md

Structs

DeviceInfo

FTDI device information.

Eeprom232h

EEPROM structure for the FT232H.

Eeprom4232h

EEPROM structure for the FT4232H.

EepromStringsError

EEPROM strings error.

EepromValueError

EEPROM value error.

Ft232h

FT232H device.

Ft4232h

FT4232H device.

Ftdi

Generic FTDI device.

MpsseSettings

Initialization settings for the MPSSE.

Version

D2XX version structure.

Enums

BitMode

BitModes for the FTDI ports.

ByteOrder

FT1248 byte order.

Cbus232h

FT232H CBUS options.

Cbus232r

FT232R CBUS options.

CbusX

FT X Series CBUS options.

ClockPolarity

FT1248 clock polarity

DeviceType

FTDI device types.

DeviceTypeError

Device type errors.

DriveCurrent

FTDI pin drive currents.

DriverType

FTDI driver type.

FtStatus

These are the C API error codes.

Speed

USB device speed.

TimeoutError

FTDI timeout errors.

Traits

FtdiCommon

FTD2XX functions common to all devices.

FtdiEeprom

FTDI device-specific EEPROM trait.

FtdiMpsse

FTDI Multi-Protocol Synchronous Serial Engine (MPSSE).

Functions

library_version

Returns the version of the underlying C library.

list_devices

This function returns a device information vector with information about the D2XX devices connected to the system.

num_devices

Returns the number of FTDI devices connected to the system.