docs.rs failed to build libbladerf-rs-0.4.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
libbladerf-rs-0.2.0
Pure Rust driver for the Nuand BladeRF1 (x40/x115) SDR. No C libbladeRF dependency. USB transport via nusb. Supports Windows, macOS, and Linux.
Feature flags
| Flag | Default | Effect |
|---|---|---|
bladerf1 |
yes* | BladeRF1 support (x40/x115) |
bladerf2 |
no | BladeRF2 support — stub only |
xb100 |
yes | XB-100 LED expansion board |
xb200 |
yes | XB-200 transverter board |
xb300 |
yes | XB-300 amplifier board |
* Enabled implicitly by xb100, xb200, or xb300.
Usage
The device is accessed through session types that switch the FX3 USB alternate
setting and borrow &mut NiosCore. The borrow checker enforces exclusive access
at compile time.
use ;
let mut dev = from_first?;
let mut sess = dev.rf_link_session?;
sess.initialize?;
let mut rx = builder
.buffer_size
.buffer_count
.format
.build?;
rx.start?;
let buf = rx.read?;
println!;
rx.recycle;
rx.close?;
Session types
| Session | USB alt setting | Capabilities |
|---|---|---|
RfLinkSession |
RfLink (0x01) | Tuning, gain, sample rate, bandwidth, streaming, expansion boards, triggers, loopback, corrections |
FlashSession |
SpiFlash (0x02) | SPI flash erase/write/verify, calibration region access |
ConfigSession |
Config (0x03) | FPGA loading, device configuration |
FlashSession and ConfigSession return Error::StreamsActive if any stream is running.
Examples
Git-tracked examples (build and run from the repository root):
| Package | Purpose |
|---|---|
info |
Basic device info and FPGA version |
rx_tx |
Streaming RX/TX with metadata headers |
calibrate |
DC calibration on LMS6002D |
dc_cal_table |
DC calibration table management |
flash_firmware |
FX3 firmware flashing |
flash_fpga |
FPGA bitstream flashing |
Supported features
- RF control: frequency (host/FPGA tuning, quick-tune), gain (per-stage apportioning, gain modes, gain stage control), sample rate (integer and rational), bandwidth, LPF mode, RF port selection
- Streaming: zero-copy DMA via BufferPool (RX/TX), metadata headers, multiple sample formats (Sc16Q11, Sc8Q7, Sc16Q11Packed, *Meta variants), pack/unpack helpers
- DC calibration: on-demand LMS6002D calibration, flash-stored JSON calibration tables with auto-load on open and frequency-specific apply
- Flash: erase/write/verify, calibration region (DAC trim, FPGA size)
- FPGA: host-based loading, flash autoload, source query, firmware log reading
- Expansion boards: XB-100 (GPIO/LED), XB-200 (filter bank, upconverter, auto filter), XB-300 (amplifier, TRX, output power)
- Other: SMB clock, VCTCXO tamer, triggers, loopback (LMS + FPGA), corrections (DC/phase), RX mux, retune scheduling, timestamps, firmware flashing
Not supported (vs C libbladeRF)
- BladeRF2 — stub only, not implemented
- Synchronous API —
bladerf_sync_config/rx/txnot implemented - Bootloader — jump to bootloader, load firmware from bootloader
- OTP (one-time programmable) — read/write/lock
- Image helpers — flash image allocate/free/read/write
- Byte-level flash — byte-addressed erase/read/write (page/sector only)
- Wishbone — master read/write
- USB reset on open — configuration option
- Multi-device / MIMO — clock sync helpers
- Tuning mode get — missing getter
- Gain calibration tables — bladeRF2-specific (not applicable to BladeRF1)
Developers
Contributions are welcome. The architecture is documented in AGENTS.md.
For debugging, compare USB traffic between libbladeRF and [libbladerf-rs] using Wireshark:
Filter example:
usb.bus_id == 1 and usb.device_address == 2
Datasheets
- SI5338 Datasheet
- SI5338 Reference Manual
- LMS6002D Datasheet
- LMS6002D Programming and Calibration Guide
- DAC161S055 Datasheet
Documentation
Testing
Unit tests (no hardware)
Integration tests (requires BladeRF1)
Specific test