libiio-sys

Crates.iolibiio-sys
lib.rslibiio-sys
version0.4.1
created_at2018-11-22 01:42:37.882836+00
updated_at2025-09-13 23:31:08.436572+00
descriptionNative, unsafe, bindings to the Linux libiio library. Used by industrial-io.
homepagehttps://github.com/fpagliughi/rust-industrial-io
repositoryhttps://github.com/fpagliughi/rust-industrial-io
max_upload_size
id98086
size1,753,301
Frank Pagliughi (fpagliughi)

documentation

README

Rust wrapper for Linux Industrial I/O library, libiio

Crates.io

Rust wrapper for the Linux Industrial I/O user-space library, libiio. This provides high-performance analog input and output on Linux systems.

Currently this defaults to bindings for libiio v0.25.

To use in an application, add this to Cargo.toml:

[dependencies]
libiio-sys = "0.4"

Generating Bindings

Bindings for different versions of the C library can be generated using the bindgen command-line tools.

Run bindgen over the iio.h header from the desired version of the library, outputting the results to a file,

bindings-<version>_<size>.rs

where <version> is the libiio version and <size> is the target CPU word size (typically 32 or 64).

So, for example, this is how we generated them v0.25, on a 64-bit system:

First we cloned the repo and checked out the proper version:

$ git clone https://github.com/analogdevicesinc/libiio.git
$ cd libiio
$ git checkout v0.25

Then into the directory for this repo, we ran bindgen on the header saving the result in the bindings directory:

$ cd industrial-io/libiio-sys/
$ bindgen ~/libiio/iio.h -o bindings/bindings-0.25_64.rs
Commit count: 170

cargo fmt