This project provides Rust bindings for the libbladeRF
library, enabling Rust developers to interface with bladeRF hardware. The bindings are generated using bindgen
and allow for direct use of libbladeRF
functions within Rust programs. This README outlines how to set up and use these bindings.
Before using these bindings, ensure that you have the following installed:
- Rust toolchain (latest stable version recommended)
libbladeRF
library installed on your system (refer to the host build instructions)
Cargo.toml
: Project configuration and dependencies.build.rs
: Build script for generating Rust bindings usingbindgen
.wrapper.h
: A header file that includes thelibbladeRF
shared library.src/lib.rs
: The Rust library file that includes the generated bindings.src/main.rs
: An example Rust application.
The following will generate the Rust bindings using bindgen
and compile the project.
cd hello_libbladeRF # Navigate to one of the Rust crates
cargo build # Navigate to the project directory and build the project using Cargo
cargo test # Run tests (including the ones in lib.rs)
cargo run # Runs the example application in src/main.rs
You can access libbladeRF
functions via the bindings in src/lib.rs
. The build.rs
script automatically generates these bindings.
This code is distributed under an MIT License.