| Crates.io | seify-hackrfone |
| lib.rs | seify-hackrfone |
| version | 0.2.0 |
| created_at | 2024-10-10 17:25:03.33623+00 |
| updated_at | 2025-04-24 16:03:13.050372+00 |
| description | Fully Rust native HackRF one driver, powered by nusb |
| homepage | |
| repository | https://github.com/MerchGuardian/seify-hackrfone |
| max_upload_size | |
| id | 1404062 |
| size | 56,074 |
Rust Hackrf One api, with zero native dependencies, powered by nusb
Written as part of seify and FutureSDR, but standalone usage is also supported.
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...
}
}