`radio` logo

`radio`

Free

Generic radio transceiver traits, mocks, and helpers - [![crates.io](https://img.shields.io/crates/v/radio.svg)](https://crates.io/crates/radio)

FreeFree tier
Type
Open Source

About `radio`

radio-hal is an embedded-hal like abstraction for digital radio devices in Rust. It provides generic core traits for transmit, receive, set channel, fetch RSSI, register access, and configuration, enabling common implementations for packet radio drivers. Blocking helper functions are automatically derived from the traits. Experimental async/await support is available via the nonblocking feature flag (requires nightly Rust and adds std/async-std dependencies). A MockRadio implementation for testing is behind the mock feature flag. The library is extensible for protocol-specific traits (e.g., 802.15.4, BLE, LoRa) and serves as a foundation for building embedded network stacks. It is a work in progress with expected API changes.

Key Features

Core traits for Transmit, Receive, Set Channel, Fetch RSSI, Register Access, and Configuration
Automatic blocking helper functions derived from traits
Experimental async/await support via nonblocking feature (nightly Rust, std, async-std)
MockRadio implementation for testing (requires nightly)
Extensible for protocol-specific traits (802.15.4, BLE, LoRa)
Register access for radio configuration

Pros & Cons

Pros
  • Provides a common abstraction for diverse radio hardware, similar to embedded-hal
  • Automatic blocking helper functions reduce boilerplate
  • Experimental async support for nonblocking operation
  • Includes MockRadio for easier testing
  • Open source under MIT license
  • Actively maintained with multiple releases and contributor activity
Cons
  • Work in progress with expected major API changes
  • Async support is experimental and requires nightly Rust and additional std dependencies
  • Focused on embedded Rust; not suitable for non-embedded use
  • Limited documentation beyond the README

Best For

Building embedded network stacks for digital radiosImplementing packet radio drivers (e.g., SX127x, SX128x, AT86RF212, S2LP)Developing IoT applications with radio connectivityPrototyping radio communication in embedded systemsWriting testable radio drivers using MockRadio

FAQ

What is radio-hal?
radio-hal is an embedded-hal like abstraction for digital radio devices in Rust. It provides generic traits for transmit, receive, channel, RSSI, etc., with blocking and optional async helpers.
Does it support async?
Yes, experimental async/await support is available behind the 'nonblocking' feature flag, but it requires a nightly Rust compiler and adds std/async-std dependencies.
Is it production-ready?
The library is a work in progress with expected API changes, but it has multiple releases and is used in driver examples for real hardware like SX127x and AT86RF212.