9 releases (5 stable)

1.1.3 Dec 13, 2023
1.1.2 Feb 13, 2022
1.1.1 Aug 12, 2021
1.0.0 Jan 29, 2021
0.1.0 Feb 2, 2016

#430 in Hardware support

Download history 4209/week @ 2023-12-17 1721/week @ 2023-12-24 2763/week @ 2023-12-31 3462/week @ 2024-01-07 4713/week @ 2024-01-14 5920/week @ 2024-01-21 5909/week @ 2024-01-28 7287/week @ 2024-02-04 8071/week @ 2024-02-11 8066/week @ 2024-02-18 8506/week @ 2024-02-25 8732/week @ 2024-03-03 8569/week @ 2024-03-10 7788/week @ 2024-03-17 7703/week @ 2024-03-24 8287/week @ 2024-03-31

32,994 downloads per month
Used in 14 crates (3 directly)

MIT and maybe LGPL-2.1 AND MIT

86KB
2K SLoC

Rust 1K SLoC // 0.0% comments C 819 SLoC // 0.3% comments

libftdi1-sys

libftdi1-sys is a crate providing Rust bindings to the C library libftdi1.

Prerequisites

This crate requires libftdi1 version 1.4 (August 2017) or later to be available as a system library that can be found with pkg-config (everywhere except windows/MSVC) or vcpkg (windows/MSVC) unless you activate the vendored feature.

By default the crate uses pregenerated bindings which should be fine in most cases. In special cases the bindings can be regenerated using the bindgen feature.

Regenerating bindings has an additional requirement that libclang must be installed and visible on your path. If you are using a gcc-toolchain and don't want to install the entirity of LLVM just for libclang, you can use the following procedure (using a Debian-based ARM system as an example):

sudo apt-get install libclang-dev
export LIBCLANG_PATH=/usr/lib/llvm-7/lib
export C_INCLUDE_PATH=/usr/lib/gcc/arm-linux-gnueabihf/8/include
cargo build

MSRV

The Minimum Supported Rust Version (MSRV) is stable 1.34. The bindgen feature is developer-oriented and does not provide any MSRV guarantees.

Features

  • libusb1-sys: depend on libusb1-sys and use real libusb types instead of placeholders. This makes it possible to interact directly with the underlying libusb structures.
  • vendored: build a custom copy of libftdi instead of using the system one. Note that this includes LGPL code in your build.
  • bindgen: Generate bindings to libftdi at compile time.

Contributing

This crate is expected to be passively maintained, not actively updated. That being said, if you want to update binding generation, you can set the LIBFTDI1_SYS_DEVEL environment variable with any value so that an updated binding file is written in src alongside the original one enabling you to compare them and copy it over the old one to update.

Dependencies

~2–470KB