Silicon Labs Radio Abstraction Interface Layer (RAIL) is a library that can be used as a generic interface for all Silicon Labs radio parts. By programming against this API you are able to write code that easily ports across different radio parts while having access to hardware acceleration wherever possible.
The RAIL library is mostly standalone with a few external dependencies. Simplicity Studio application builder is not required but is recommended because it simplifies building applications using RAIL. Depending on the hardware platform that you're using you may be required to provide certain HAL functionality for the library to work properly. These functions are described in hardware-specific documentation sections and valid implementations can be found as a part of the provided emlib/emdrv HAL layers. It is recommended that you use these versions for maximum support, but you're free to re-implement them if necessary.
At a high level, the functionality supported by RAIL is shown below. For more specifics on the APIs and how to use them see the module documentation.
- Initialize the RAIL API layer.
- Collect entropy from the radio (if available).
- Radio Configuration
- Configure the radio frequency, packet format, channel configuration and other PHY parameters.
- Query current PHY data rates and parameters like current channel.
- State Transitions
- Configure automatic radio state transitions and transition timings.
- Auto ACK
- Configure the radio for automatic acknowledgments.
- Load the auto ack payload.
- System Timing
- Get the current time in the RAIL timebase.
- Configure a timer to trigger an event callback after an absolute or relative delay.
- Specify where within a packet its timestamp is desired.
- Configure which radio or RAIL events the application wants to be told about via callback.
- Data Management
- Allows the application to choose the type of data and the method of data interaction through RAIL.
- Configure receive options like CRC checking.
- Start or schedule when to receive.
- Enable and configure Address Filtering for each packet.
- Configure the power amplifier (PA) and set transmit power output.
- Load and send packet data, either immediately, scheduled, or using CSMA or LBT.
- Control per-transmit options like CRC generation, ACK waiting, etc.
- Manage time-sharing of the radio among different protocols.
- APIs for handling various radio calibrations for optimal performance.
- RF Sense
- Enable RF energy sensing of specified duration across the 2.4 GHz and/or Sub-GHz bands (EFR32 only).
- Packet Trace (PTI)
- Configure Packet Trace pins and serial protocol.
- Specify the stack protocol to aid network analyzer packet decoding.
- Output debug signals like an unmodulated tone and a continuously modulated stream of data.
- Configure crystal tuning for your radio.
- Fine-tune the radio tuner frequency.
Protocol-specific hardware acceleration:
- IEEE 802.15.4
- Configure the IEEE802.15.4 2.4GHz PHY.
- Configure node address and address filtering for IEEE 802.15.4.
- Configure auto ack for IEEE 802.15.4.
- Configure the Bluetooth Low Energy 1Mbit PHY.
- Preamble, sync word and whitening adjustment function for connections.
Getting Started Example
Below is a simple example to show you how to initialize the RAIL library in your application. Notice that this requires the channel configurations which can be generated from the radio calculator in Simplicity Studio. By default, RAIL interacts with data on a per-packet basis. For more information, see Data Management.
Note: Before the radio can transmit, make sure the PA is initialized for your platform, which is described in the Hardware-specific Configuration section below.
For hardware-specific configuration and setup information, see subsequent sections.