The 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 as standalone as it can be with few external dependencies. To build applications using it we recommend using Simplicity Studio's application builder since it will simplify the process but that is not required. 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 should be covered in the section of the guide for your hardware platform and valid implementations of them can be found as a part of the emlib/emdrv HAL layers that we provide. 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 refer to Data Management.
Note: Before the radio can transmit, make sure the PA is initialized for your platform. This is covered in the Hardware Specific Configuration section below.
Hardware Specific Configuration
For information about configuration and setup that is specific to your hardware platform be sure to take a look at the pages below.