Expand description
A reimplementation of basic libbladeRF functions in Rust, based on nusb.
Use libbladerf-rs to control your bladeRF from your Rust application. libbladerf-rs shall currently not be considered as a replacement for the official libbladeRF due to several features not being available.
§Usage overview
After a BladeRF is connected via USB (High or SuperSpeed USB port required) and fully booted,
an instance to a BladeRF can be opened using bladerf1::BladeRf1::from_first. A handle to a specific BladeRF
can also be obtained by its bladerf1::BladeRf1::from_bus_addr or its bladerf1::BladeRf1::from_serial or
bladerf1::BladeRf1::from_fd on Android.
After obtaining an instance of a bladerf1::BladeRf1, you can set basic parameters like Gain, Frequency
and Sample Rate or Bandwidth.
§Examples
An example exists to demonstrate the current functionality of libbladerf-rs:
cargo run --package info§Limitations
libbladerf-rs currently only supports the BladeRF1. Support for BladeRF2 is currently not possible, as I am not in the possession of named SDR.
§Implemented Features
- Getting/Setting gain levels of individual stages like rxvga1, rxvga2, lna, txvga1 and txvga2.
- Getting/Setting RX/TX frequency
- Getting/Setting Bandwidth
- Getting/Setting Sample Rate
- Support for BladeRF1 Expansion boards (XB100, XB200, XB300)
- Interface for sending and receiving I/Q samples
§Missing Features
- Support for BladeRF2
- Support for Firmware and FPGA flashing/validation
- Support for different I/Q sample formats and timestamps
- DC calibration table support
- Usage from both async and blocking contexts (currently sync only)
- Extensive documentation
- AGC enablement
§Developers
Contributions of any kind are welcome!
If possible, method names should adhere to the documented methods in libbladeRF-doc
For debugging purposes, it is useful to compare the communication between the SDR and the original libbladeRF with the communication of libbladerf-rs. Hand tooling for this purpose is Wireshark. Allow wireshark to monitor USB traffic:
sudo usermod -a -G wireshark <your_user>
sudo modprobe usbmon
sudo setfacl -m u:<your_user>:r /dev/usbmon*Filter out unwanted traffic by using a Wireshark filter like e.g.
usb.bus_id == 1 and usb.device_address == 2Datasheets for the BladeRF1 hardware are available at the following resources:
§SI5338
§LMS6002D
LMS6002D Programming and Calibration Guide
§DAC161S055
Re-exports§
Modules§
Macros§
- ms_
to_ samples - Convert ms to samples
Structs§
- Semantic
Version - Version structure for FPGA, firmware, libbladeRF, and associated utilities
Enums§
Type Aliases§
- Result
- Result type for operations that may return an
Error.