This file contains the type definitions for efr32xg1x chip-specific aspects of RAIL.
License#
Copyright 2020 Silicon Laboratories Inc. www.silabs.com
SPDX-License-Identifier: Zlib
The licensor of this software is Silicon Laboratories Inc.
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
This notice may not be removed or altered from any source distribution.
Modules#
Macros#
Include guard.
The RAIL library does not use enumerations because the ARM EABI leaves their size ambiguous, which causes problems if the application is built with different flags than the library.
This macro is a more generic version of the RAIL_ENUM() macro that allows the size of the type to be overridden instead of forcing the use of a uint8_t.
A placeholder for a chip-specific RAIL handle.
Time it takes to take care of protocol switching.
EFR32-specific temperature calibration bit.
EFR32-specific HFXO temperature check bit.
EFR32-specific HFXO compensation bit.
EFR32-specific IR calibration bit.
EFR32-specific IR calibration bit.
A mask to run temperature-dependent calibrations.
A mask to run one-time calibrations.
A mask to run optional performance calibrations.
A mask for calibrations that require the radio to be off.
A mask to run all possible calibrations for this chip.
A mask to run all pending calibrations.
An invalid calibration value.
Indicates the number of RF Paths supported.
A define to set all RAIL_IrCalValues_t values to uninitialized.
A define allowing Rx calibration value access compatibility between series 1 and series 2.
A define to set all RAIL_CalValues_t values to uninitialized.
The maximum frequency offset value supported by this radio.
The minimum frequency offset value supported by this radio.
Specify an invalid frequency offset value.
Returned by RAIL_GetPaPowerSetting when the device does not support the dBm to power setting mapping table.
The maximum valid value for the RAIL_TxPowerLevel_t when in RAIL_TX_POWER_MODE_2P4_LP mode.
The maximum valid value for the RAIL_TxPowerLevel_t when in RAIL_TX_POWER_MODE_2P4_HP mode.
The maximum valid value for the RAIL_TxPowerLevel_t when in RAIL_TX_POWER_MODE_SUBGIG mode.
The minimum valid value for the RAIL_TxPowerLevel_t when in RAIL_TX_POWER_MODE_2P4_LP mode.
The minimum valid value for the RAIL_TxPowerLevel_t when in RAIL_TX_POWER_MODE_2P4_HP mode.
The minimum valid value for the RAIL_TxPowerLevel_t when in RAIL_TX_POWER_MODE_SUBGIG mode.
Invalid RAIL_TxPowerLevel_t value returned when an error occurs with RAIL_GetTxPower.
Sentinel value that can be passed to RAIL_SetTxPower to set the highest power level available on the current PA, regardless of which one is selected.
Backwards compatibility define.
Backwards compatibility define.
Backwards compatibility define.
Backwards compatibility define.
Backwards compatibility define.
Backwards compatibility define.
The number of PA's on this chip.
The names of the TX power modes.
Use this value with either TX or RX values in RAIL_SetPaCTune to use whatever value is already set and do no update.
An option to configure HFXO retiming.
An option to configure HFRCO retiming.
An option to configure DCDC retiming.
A value representing no retiming options.
A value representing all retiming options.
The static amount of memory needed per channel for channel hopping, measured in 32 bit words, regardless of the size of radio configuration structures.
Default PRS channel to use when configuring sleep.
Default RTCC channel to use when configuring sleep.
Default timer synchronization configuration.
Fixed-width type indicating the needed alignment for RX and TX FIFOs.
Alignment that is needed for the RX and TX FIFOs.
The minimum value for a consistent RAIL transition.
The maximum value for a consistent RAIL transition.
Enumerations#
Antenna path Selection enumeration.
An enumeration of the EFR32 power modes.
A channel type enumeration.
Retiming options bit shifts.
Typedefs#
Provided for backwards compatibility.
RAIL_IrCalValues_t.
A calibration value structure.
Chip-specific type that represents the number of Frequency Offset units.
The radio configuration structure.
Raw power levels used directly by the RAIL_Get/SetTxPower API where a higher numerical value corresponds to a higher output power.
PA power setting used directly by the RAIL_GetPaPowerSetting() and RAIL_SetPaPowerSetting() APIs which is decoded to the actual hardware register value(s).
(_SILICON_LABS_32B_SERIES_1_CONFIG == 1)
Functions#
Apply a given image rejection calibration value.
Apply a given image rejection calibration value.
Run the image rejection calibration.
Run the image rejection calibration.
Calibrate image rejection for IEEE 802.15.4 2.4 GHz.
Calibrate image rejection for IEEE 802.15.4 915 MHz and 868 MHz.
Calibrate image rejection for Bluetooth Low Energy.
Run the temperature calibration.
Performs HFXO compensation.
Configure retiming options.
Get the currently configured retiming option.
Indicate that the DCDC peripheral bus clock enable has changed allowing RAIL to react accordingly.
Enumeration Documentation#
RAIL_AntennaSel_t#
RAIL_AntennaSel_t
Antenna path Selection enumeration.
Enumerator | |
---|---|
RAIL_ANTENNA_0 | Enum for antenna path 0. |
RAIL_ANTENNA_1 | Enum for antenna path 1. |
RAIL_ANTENNA_AUTO | Enum for antenna path auto. |
RAIL_TxPowerMode_t#
RAIL_TxPowerMode_t
An enumeration of the EFR32 power modes.
The power modes on the EFR32 correspond to the different on-chip PAs that are available. For more information about the power and performance characteristics of a given amplifier, see the data sheet.
Enumerator | |
---|---|
RAIL_TX_POWER_MODE_2P4GIG_HP | High-power amplifier, up to 20 dBm, raw values: 0-252. |
RAIL_TX_POWER_MODE_2P4GIG_LP | Low-power amplifier, up to 0 dBm, raw values: 1-7. |
RAIL_TX_POWER_MODE_SUBGIG | SubGig amplifier, up to 20 dBm, raw values: 0-248. |
RAIL_TX_POWER_MODE_NONE | Invalid amplifier Selection. |
RAIL_PtiMode_t#
RAIL_PtiMode_t
A channel type enumeration.
Enumerator | |
---|---|
RAIL_PTI_MODE_DISABLED | Turn PTI off entirely. |
RAIL_PTI_MODE_SPI | SPI mode. |
RAIL_PTI_MODE_UART | UART mode. |
RAIL_PTI_MODE_UART_ONEWIRE | 9-bit UART mode. |
RAIL_RetimeOptions_t#
RAIL_RetimeOptions_t
Retiming options bit shifts.
Enumerator | |
---|---|
RAIL_RETIME_OPTION_HFXO_SHIFT | Shift position of RAIL_RETIME_OPTION_HFXO bit. |
RAIL_RETIME_OPTION_HFRCO_SHIFT | Shift position of RAIL_RETIME_OPTION_HFRCO bit. |
RAIL_RETIME_OPTION_DCDC_SHIFT | Shift position of RAIL_RETIME_OPTION_DCDC bit. |
Typedef Documentation#
RAIL_IrCalValues_t#
typedef uint32_t RAIL_IrCalValues_t[1] [1]
RAIL_IrCalValues_t.
An IR calibration value structure.
This definition contains the set of persistent calibration values for EFR32. You can set these beforehand and apply them at startup to save the time required to compute them. Any of these values may be set to RAIL_IRCAL_INVALID_VALUE to force the code to compute that calibration value.
RAIL_CalValues_t#
RAIL_CalValues_t
A calibration value structure.
This structure contains the set of persistent calibration values for EFR32. You can set these beforehand and apply them at startup to save the time required to compute them. Any of these values may be set to RAIL_CAL_INVALID_VALUE to force the code to compute that calibration value.
RAIL_FrequencyOffset_t#
RAIL_FrequencyOffset_t
Chip-specific type that represents the number of Frequency Offset units.
It is used with RAIL_GetRxFreqOffset() and RAIL_SetFreqOffset().
The units on this chip are radio synthesizer resolution steps (synthTicks). On EFR32 (at least for now), the frequency offset is limited to 15 bits (size of SYNTH_CALOFFSET). A value of RAIL_FREQUENCY_OFFSET_INVALID means that this value is invalid.
RAIL_RadioConfig_t#
typedef const uint32_t* RAIL_RadioConfig_t
The radio configuration structure.
The radio configuration properly configures the radio for operation on a protocol. These configurations should not be created or edited by hand.
RAIL_TxPowerLevel_t#
typedef uint8_t RAIL_TxPowerLevel_t
Raw power levels used directly by the RAIL_Get/SetTxPower API where a higher numerical value corresponds to a higher output power.
These are referred to as 'raw (values/units)'. On EFR32, they can range from one of RAIL_TX_POWER_LEVEL_2P4_LP_MIN, RAIL_TX_POWER_LEVEL_2P4_HP_MIN, or RAIL_TX_POWER_LEVEL_SUBGIG_HP_MIN to one of RAIL_TX_POWER_LEVEL_2P4_LP_MAX, RAIL_TX_POWER_LEVEL_2P4_HP_MAX, and RAIL_TX_POWER_LEVEL_SUBGIG_HP_MAX, respectively, depending on the selected RAIL_TxPowerMode_t.
RAIL_PaPowerSetting_t#
typedef uint32_t RAIL_PaPowerSetting_t
PA power setting used directly by the RAIL_GetPaPowerSetting() and RAIL_SetPaPowerSetting() APIs which is decoded to the actual hardware register value(s).
RAIL_TransitionTime_t#
RAIL_TransitionTime_t
(_SILICON_LABS_32B_SERIES_1_CONFIG == 1)
Suitable type for the supported transition time range.
Function Documentation#
RAIL_ApplyIrCalibration#
RAIL_Status_t RAIL_ApplyIrCalibration (RAIL_Handle_t railHandle, uint32_t imageRejection)
Apply a given image rejection calibration value.
Type | Direction | Argument Name | Description |
---|---|---|---|
RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
uint32_t | [in] | imageRejection | The image rejection value to apply. |
Returns
A status code indicating success of the function call.
Take an image rejection calibration value and apply it. This value should be determined from a previous run of RAIL_CalibrateIr on the same physical device with the same radio configuration. The imageRejection value will also be stored to the RAIL_ChannelConfigEntry_t::attr, if possible.
If multiple protocols are used, this function will return RAIL_STATUS_INVALID_STATE if it is called and the given railHandle is not active. In that case, the caller must attempt to re-call this function later.
DeprecatedPlease use RAIL_ApplyIrCalibrationAlt instead.
RAIL_ApplyIrCalibrationAlt#
RAIL_Status_t RAIL_ApplyIrCalibrationAlt (RAIL_Handle_t railHandle, RAIL_IrCalValues_t * imageRejection, RAIL_AntennaSel_t rfPath)
Apply a given image rejection calibration value.
Type | Direction | Argument Name | Description |
---|---|---|---|
RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
RAIL_IrCalValues_t * | [in] | imageRejection | Pointer to the image rejection value to apply. |
RAIL_AntennaSel_t | [in] | rfPath | RF path to calibrate. |
Returns
A status code indicating success of the function call.
Take an image rejection calibration value and apply it. This value should be determined from a previous run of RAIL_CalibrateIrAlt on the same physical device with the same radio configuration. The imageRejection value will also be stored to the RAIL_ChannelConfigEntry_t::attr, if possible. Note
: To make sure the imageRejection value is stored/configured correctly, RAIL_ConfigAntenna should be called before calling this API.
If multiple protocols are used, this function will return RAIL_STATUS_INVALID_STATE if it is called and the given railHandle is not active. In that case, the caller must attempt to re-call this function later.
RAIL_CalibrateIr#
RAIL_Status_t RAIL_CalibrateIr (RAIL_Handle_t railHandle, uint32_t * imageRejection)
Run the image rejection calibration.
Type | Direction | Argument Name | Description |
---|---|---|---|
RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
uint32_t * | [out] | imageRejection | The result of the image rejection calibration. |
Returns
A status code indicating success of the function call.
Run the image rejection calibration and apply the resulting value. If the imageRejection parameter is not NULL, store the value at that location. The imageRejection value will also be stored to the RAIL_ChannelConfigEntry_t::attr, if possible. This is a long-running calibration that adds significant code space when run and can be run with a separate firmware image on each device to save code space in the final image.
If multiple protocols are used, this function will make the given railHandle active, if not already, and perform calibration. If called during a protocol switch, it will return RAIL_STATUS_INVALID_STATE. In this case, RAIL_ApplyIrCalibration may be called to apply a previously determined IR calibration value, or the app must defer calibration until the protocol switch is complete. Silicon Labs recommends calling this function from the application main loop.
DeprecatedPlease use RAIL_CalibrateIrAlt instead.
RAIL_CalibrateIrAlt#
RAIL_Status_t RAIL_CalibrateIrAlt (RAIL_Handle_t railHandle, RAIL_IrCalValues_t * imageRejection, RAIL_AntennaSel_t rfPath)
Run the image rejection calibration.
Type | Direction | Argument Name | Description |
---|---|---|---|
RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
RAIL_IrCalValues_t * | [out] | imageRejection | Pointer to the image rejection result. |
RAIL_AntennaSel_t | [in] | rfPath | RF path to calibrate. |
Returns
A status code indicating success of the function call.
Run the image rejection calibration and apply the resulting value. If the imageRejection parameter is not NULL, store the value at that location. The imageRejection value will also be stored to the RAIL_ChannelConfigEntry_t::attr, if possible. This is a long-running calibration that adds significant code space when run and can be run with a separate firmware image on each device to save code space in the final image. Note
: To make sure the imageRejection value is stored/configured correctly, RAIL_ConfigAntenna should be called before calling this API.
If multiple protocols are used, this function will return RAIL_STATUS_INVALID_STATE if it is called and the given railHandle is not active. In that case, the caller must attempt to re-call this function later.
RAIL_IEEE802154_CalibrateIr2p4Ghz#
RAIL_Status_t RAIL_IEEE802154_CalibrateIr2p4Ghz (RAIL_Handle_t railHandle, uint32_t * imageRejection)
Calibrate image rejection for IEEE 802.15.4 2.4 GHz.
Type | Direction | Argument Name | Description |
---|---|---|---|
RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
uint32_t * | [out] | imageRejection | The result of the image rejection calibration. |
Returns
A status code indicating success of the function call.
Some chips have protocol-specific image rejection calibrations programmed into their flash. This function will either get the value from flash and apply it, or run the image rejection algorithm to find the value.
RAIL_IEEE802154_CalibrateIrSubGhz#
RAIL_Status_t RAIL_IEEE802154_CalibrateIrSubGhz (RAIL_Handle_t railHandle, uint32_t * imageRejection)
Calibrate image rejection for IEEE 802.15.4 915 MHz and 868 MHz.
Type | Direction | Argument Name | Description |
---|---|---|---|
RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
uint32_t * | [out] | imageRejection | The result of the image rejection calibration. |
Returns
A status code indicating success of the function call.
Some chips have protocol-specific image rejection calibrations programmed into their flash. This function will either get the value from flash and apply it, or run the image rejection algorithm to find the value.
RAIL_BLE_CalibrateIr#
RAIL_Status_t RAIL_BLE_CalibrateIr (RAIL_Handle_t railHandle, uint32_t * imageRejection)
Calibrate image rejection for Bluetooth Low Energy.
Type | Direction | Argument Name | Description |
---|---|---|---|
RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
uint32_t * | [out] | imageRejection | The result of the image rejection calibration. |
Returns
A status code indicating success of the function call.
Some chips have protocol-specific image rejection calibrations programmed into their flash. This function will either get the value from flash and apply it, or run the image rejection algorithm to find the value.
RAIL_CalibrateTemp#
RAIL_Status_t RAIL_CalibrateTemp (RAIL_Handle_t railHandle)
Run the temperature calibration.
Type | Direction | Argument Name | Description |
---|---|---|---|
RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
Returns
A status code indicating success of the function call.
Run the temperature calibration, which needs to recalibrate the synth if the temperature crosses 0C or the temperature delta since the last calibration exceeds 70C while in receive. RAIL will run the VCO calibration automatically upon entering receive or transmit states, so the application can omit this calibration if the stack re-enters receive or transmit with enough frequency to avoid reaching the temperature delta. If the application does not calibrate for temperature, it's possible to miss receive packets due to a drift in the carrier frequency.
If multiple protocols are used, this function will return RAIL_STATUS_INVALID_STATE if it is called and the given railHandle is not active. In that case, the calibration will be automatically performed next time the radio enters receive.
RAIL_CalibrateHFXO#
RAIL_Status_t RAIL_CalibrateHFXO (RAIL_Handle_t railHandle, int8_t * crystalPPMError)
Performs HFXO compensation.
Type | Direction | Argument Name | Description |
---|---|---|---|
RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
int8_t * | [out] | crystalPPMError | Current deviation that has been corrected, measured in PPM. May be NULL. |
Returns
A status code indicating the result of the function call.
Compute the PPM correction using the thermistor value available when RAIL_EVENT_THERMISTOR_DONE occurs, after RAIL_StartThermistorMeasurement() call. Then correct the RF frequency as well as TX and RX sampling.
This function calls the following RAIL functions in sequence saving having to call them individually:
Note
This function makes the radio idle.
RAIL_ConfigRetimeOptions#
RAIL_Status_t RAIL_ConfigRetimeOptions (RAIL_Handle_t railHandle, RAIL_RetimeOptions_t mask, RAIL_RetimeOptions_t options)
Configure retiming options.
Type | Direction | Argument Name | Description |
---|---|---|---|
RAIL_Handle_t | [in] | railHandle | A handle of RAIL instance. |
RAIL_RetimeOptions_t | [in] | mask | A bitmask containing which options should be modified. |
RAIL_RetimeOptions_t | [in] | options | A bitmask containing desired configuration settings. Bit positions for each option are found in the RAIL_RetimeOptions_t. |
Returns
Status code indicating success of the function call.
RAIL_GetRetimeOptions#
RAIL_Status_t RAIL_GetRetimeOptions (RAIL_Handle_t railHandle, RAIL_RetimeOptions_t * pOptions)
Get the currently configured retiming option.
Type | Direction | Argument Name | Description |
---|---|---|---|
RAIL_Handle_t | [in] | railHandle | A handle of RAIL instance. |
RAIL_RetimeOptions_t * | [out] | pOptions | A pointer to configured retiming options bitmask indicating which are enabled. |
Returns
Status code indicating success of the function call.
RAIL_ChangedDcdc#
RAIL_Status_t RAIL_ChangedDcdc (void )
Indicate that the DCDC peripheral bus clock enable has changed allowing RAIL to react accordingly.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Note
This should be called after DCDC has been enabled or disabled.
Returns
Status code indicating success of the function call.