#sdr #hackrf #rf #api-bindings

seify-hackrfone

Fully Rust native HackRF one driver, powered by nusb

3 unstable releases

Uses new Rust 2024

0.2.0 Apr 24, 2025
0.1.1 Nov 16, 2024
0.1.0 Oct 10, 2024

#1 in #rf

Download history 9/week @ 2025-02-19 126/week @ 2025-04-23 20/week @ 2025-04-30

146 downloads per month
Used in 2 crates (via seify)

MIT license

33KB
660 lines

seify-hackrfone   Crates.io Documentation Build Status Made with Rust

Rust Hackrf One api, with zero native dependencies, powered by nusb

Written as part of seify and FutureSDR, but standalone usage is also supported.

Example

use anyhow::Result;
use seify_hackrfone::{Config, HackRf};

fn main() -> Result<()> {
    let radio = HackRf::open_first()?;

    radio.start_rx(&Config {
        vga_db: 0,
        txvga_db: 0,
        lna_db: 0,
        amp_enable: false,
        antenna_enable: false,
        frequency_hz: 915_000_000,
        sample_rate_hz: 2_000_000,
        sample_rate_div: 1,
    })?;

    let mut buf = vec![0u8; 32 * 1024];
    loop {
        radio.read(&mut buf)?;
        // Process samples...
    }
}

Dependencies

~0.9–14MB
~131K SLoC