Expand description
Pure-Rust port of libairspy — USB driver for the Airspy R2 / Mini software-defined radio receivers, with no C library dependency.
This is a faithful port: USB wire behavior, sample-pipeline
semantics, and DSP output match the original C library, behind an
idiomatic Rust surface (RAII device handles, Result-based errors,
typed enums, and Iterator/Stream-based sample delivery).
The crate is under active construction; the conversion is tracked in milestones on GitHub.
Re-exports§
pub use board::PartIdSerial;pub use conversion::Samples;pub use device::Device;pub use device::list_devices;pub use error::Error;pub use error::Result;
Modules§
- board
- Board information reads, ported from
airspy_board_id_read,airspy_version_string_read, andairspy_board_partid_serialno_readinairspy.c. - commands
- Wire-level constants and enums shared with the Airspy firmware,
transcribed from
airspy_commands.handairspy.h. - conversion
- Sample-format conversion, starting with the 12-bit packed-mode
unpacker (
unpack_samplesin airspy.c). The IQ converters land here with the DSP milestone. - device
- Device enumeration and lifecycle, ported from
airspy.c’sairspy_list_devices/airspy_open_device/airspy_open_exit. - error
- Error type mirroring
enum airspy_errorfromairspy.h. - reader
- Blocking
Iteratorsample delivery — the sync alternative to thecrate::Device::start_rxcallback, mirroring librtlsdr-rs’s reader shape. Blocks are bridged off the consumer thread over a bounded channel; when the iterator falls behind, the channel fills, the consumer stalls, and the ring’s C drop accounting takes over. - stream
- The bulk-transfer streaming engine, ported from
airspy.c’s transfer machinery:airspy_start_rx/airspy_stop_rx/airspy_is_streaming, the libusb transfer callback’s 8-slot swap ring, and the producer/consumer thread pair. - stream_
smol - Smol
Streamadapter — gated onfeature = "smol", mirroring librtlsdr-rs’s per-runtime bridge shape (async-channel’sReceiveralready implementsStream;blockingis not needed because this engine owns its own threads). - stream_
tokio - Tokio
Streamadapter — gated onfeature = "tokio", mirroring librtlsdr-rs’s per-runtime bridge shape.
Structs§
- LibVersion
- Library version, mirroring
airspy_lib_version/airspy_lib_version_t— reporting this crate’s own version rather than the C library’s 1.0.12.
Functions§
- lib_
version - The version of this crate (
airspy_lib_versionsemantics).