RF Sense

Data Structures

struct  RAIL_RfSenseSelectiveOokConfig_t
 Structure to configure RFSENSE Selective(OOK) mode.

Macros

#define RAIL_RFSENSE_LOW_SENSITIVITY_OFFSET   (0x20U)
 RF Sense low sensitivity offset.
 
#define RAIL_RFSENSE_USE_HW_SYNCWORD   (0U)
 Use the MODEM default sync word.

Typedefs

typedef void(* RAIL_RfSense_CallbackPtr_t) (void)
 A pointer to an RF Sense callback function.

Enumerations

enum  RAIL_RfSenseBand_t {
  RAIL_RFSENSE_OFF,
  RAIL_RFSENSE_2_4GHZ,
  RAIL_RFSENSE_SUBGHZ,
  RAIL_RFSENSE_ANY,
  RAIL_RFSENSE_MAX,
  RAIL_RFSENSE_2_4GHZ_LOW_SENSITIVITY = (0x20U) + RAIL_RFSENSE_2_4GHZ,
  RAIL_RFSENSE_SUBGHZ_LOW_SENSITIVITY = (0x20U) + RAIL_RFSENSE_SUBGHZ,
  RAIL_RFENSE_ANY_LOW_SENSITIVITY = (0x20U) + RAIL_RFSENSE_ANY
}
 An enumeration for specifying the RF Sense frequency band.

Functions

RAIL_Time_t RAIL_StartRfSense (RAIL_Handle_t railHandle, RAIL_RfSenseBand_t band, RAIL_Time_t senseTime, RAIL_RfSense_CallbackPtr_t cb)
 Start/stop the RF Sense functionality in Energy Detection Mode for use during low-energy sleep modes.
 
RAIL_Status_t RAIL_StartSelectiveOokRfSense (RAIL_Handle_t railHandle, RAIL_RfSenseSelectiveOokConfig_t *config)
 Start/stop the RF Sense functionality in Selective(OOK Based) Mode for use during low-energy sleep modes.
 
RAIL_Status_t RAIL_ConfigRfSenseSelectiveOokWakeupPhy (RAIL_Handle_t railHandle)
 Switch to RF Sense Selective(OOK) PHY.
 
RAIL_Status_t RAIL_SetRfSenseSelectiveOokWakeupPayload (RAIL_Handle_t railHandle, uint8_t numSyncwordBytes, uint32_t syncword)
 Set the transmit payload for waking up a node configured for RF Sense Selective(OOK).
 
bool RAIL_IsRfSensed (RAIL_Handle_t railHandle)
 Check whether the RF was sensed.

Typedef Documentation

◆ RAIL_RfSense_CallbackPtr_t

typedef void(* RAIL_RfSense_CallbackPtr_t) (void)

A pointer to an RF Sense callback function.

Consider using the event RAIL_EVENT_RF_SENSED as an alternative.

Definition at line 3515 of file rail_types.h.

Enumeration Type Documentation

◆ RAIL_RfSenseBand_t

An enumeration for specifying the RF Sense frequency band.

Enumerator
RAIL_RFSENSE_OFF 

RF Sense is disabled.

RAIL_RFSENSE_2_4GHZ 

RF Sense is in 2.4 G band.

RAIL_RFSENSE_SUBGHZ 

RF Sense is in subgig band.

RAIL_RFSENSE_ANY 

RF Sense is in both bands.

RAIL_RFSENSE_2_4GHZ_LOW_SENSITIVITY 

RF Sense is in low sensitivity 2.4 G band.

RAIL_RFSENSE_SUBGHZ_LOW_SENSITIVITY 

RF Sense is in low sensitivity subgig band.

RAIL_RFENSE_ANY_LOW_SENSITIVITY 

RF Sense is in low sensitivity for both bands.

Definition at line 3526 of file rail_types.h.

Function Documentation

◆ RAIL_ConfigRfSenseSelectiveOokWakeupPhy()

RAIL_Status_t RAIL_ConfigRfSenseSelectiveOokWakeupPhy ( RAIL_Handle_t  railHandle)

Switch to RF Sense Selective(OOK) PHY.

Parameters
[in]railHandleA handle for RAIL instance.
Returns
A status code indicating success of the function call.

This function switches to the RFSENSE Selective(OOK) PHY for transmitting a packet to wake up a chip that supports Selective RF energy detection (OOK mode). You may only call this function while the radio is idle. While the radio is configured for this PHY, receive functionality should not be used.

Note
The user must also set up the transmit FIFO, via RAIL_SetRfSenseSelectiveOokWakeupPayload, post this function call to include the first byte as the Preamble Byte, followed by the Syncword (1byte - 4bytes). See chip-specific documentation for more details.

◆ RAIL_IsRfSensed()

bool RAIL_IsRfSensed ( RAIL_Handle_t  railHandle)

Check whether the RF was sensed.

Parameters
[in]railHandleA RAIL instance handle.
Returns
true if RF was sensed since the last call to RAIL_StartRfSense. False otherwise.

This function is useful if RAIL_StartRfSense is called with a null callback. It is generally used after EM4 reboot but can be used any time.

◆ RAIL_SetRfSenseSelectiveOokWakeupPayload()

RAIL_Status_t RAIL_SetRfSenseSelectiveOokWakeupPayload ( RAIL_Handle_t  railHandle,
uint8_t  numSyncwordBytes,
uint32_t  syncword 
)

Set the transmit payload for waking up a node configured for RF Sense Selective(OOK).

Parameters
[in]railHandleA handle for RAIL instance.
[in]numSyncwordBytesSyncword Length in bytes, 1-4 bytes.
[in]syncwordSyncword Value.
Returns
A status code indicating success of the function call.
Note
You must call this function after the chip has been set up with the RF Sense Selective(OOK) PHY, using RAIL_ConfigRfSenseSelectiveOokWakeupPhy.

◆ RAIL_StartRfSense()

RAIL_Time_t RAIL_StartRfSense ( RAIL_Handle_t  railHandle,
RAIL_RfSenseBand_t  band,
RAIL_Time_t  senseTime,
RAIL_RfSense_CallbackPtr_t  cb 
)

Start/stop the RF Sense functionality in Energy Detection Mode for use during low-energy sleep modes.

Parameters
[in]railHandleA RAIL instance handle.
[in]bandThe frequency band(s) on which to sense the RF energy. To stop RF Sense, specify RAIL_RFSENSE_OFF.
[in]senseTimeThe time (in microseconds) the RF energy must be continually detected to be considered "sensed".
[in]cbRAIL_RfSense_CallbackPtr_t is called when the RF is sensed. Set null if polling via RAIL_IsRfSensed().
Returns
The actual senseTime used, which may be different than requested due to limitations of the hardware. If 0, RF sense was disabled or could not be enabled (no callback will be issued).

The EFR32 has the ability to sense the presence of RF Energy above -20 dBm within either or both the 2.4 GHz and Sub-GHz bands and trigger an event if that energy is continuously present for certain durations of time.

Note
After RF energy has been sensed, the RF Sense is automatically disabled and RAIL_StartRfSense() must be called again to reactivate it. If RF energy has not been sensed and to manually disable RF Sense, RAIL_StartRfSense() must be called with band specified as RAIL_RFSENSE_OFF or with senseTime set to 0 microseconds.
Packet reception is not guaranteed to work correctly once RF Sense is enabled, both in single protocol and multiprotocol RAIL. To be safe, an application should turn this on only after idling the radio to stop receive and turn it off before attempting to restart receive. Since EM4 sleep causes the chip to come up through the reset vector any wake from EM4 must also shut off RF Sense to ensure proper receive functionality.
Warning
For some chips, RF Sense functionality is only guaranteed within a specified temperature range. See chip-specific documentation for more details.

◆ RAIL_StartSelectiveOokRfSense()

RAIL_Status_t RAIL_StartSelectiveOokRfSense ( RAIL_Handle_t  railHandle,
RAIL_RfSenseSelectiveOokConfig_t config 
)

Start/stop the RF Sense functionality in Selective(OOK Based) Mode for use during low-energy sleep modes.

Parameters
[in]railHandleA RAIL instance handle.
[in]configRAIL_RfSenseSelectiveOokConfig_t holds the RFSENSE configuration for Selective(OOK) mode.
Returns
Status code indicating success of the function call.

Some chips support Selective RF energy detection (OOK mode) where the user can program the chip to look for a particular sync word pattern (1byte - 4bytes) sent using OOK and wake only when that is detected. See chip-specific documentation for more details.

The following code gives an example of how to use RF Sense functionality in Selective(OOK Based) Mode.

// Syncword Length in bytes, 1-4 bytes.
#define NUMSYNCWORDBYTES (2U)
// Syncword Value.
#define SYNCWORD (0xB16FU)
// Configure the transmitting node for sending the wakeup packet.
RAIL_Idle(railHandle, RAIL_IDLE_ABORT, true);
RAIL_SetRfSenseSelectiveOokWakeupPayload(railHandle, NUMSYNCWORDBYTES, SYNCWORD);
RAIL_StartTx(railHandle, channel, RAIL_TX_OPTIONS_DEFAULT, NULL);
// Configure the receiving node (EFR32XG22) for RF Sense.
.band = rfBand,
.syncWordNumBytes = NUMSYNCWORDBYTES,
.syncWord = SYNCWORD,
.cb = &RAILCb_SensedRf
};
RAIL_StartSelectiveOokRfSense(railHandle, &config);
Note
After RF energy has been sensed, the RF Sense is automatically disabled and RAIL_StartSelectiveOokRfSense() must be called again to reactivate. If RF energy has not been sensed and to manually disable RF Sense, RAIL_StartSelectiveOokRfSense() must be called with band specified as RAIL_RFSENSE_OFF or with RAIL_RfSenseSelectiveOokConfig_t as NULL.
Packet reception is not guaranteed to work correctly once RF Sense is enabled, both in single protocol and multiprotocol RAIL. To be safe, an application should turn this on only after idling the radio to stop receive and turn it off before attempting to restart receive. Since EM4 sleep causes the chip to come up through the reset vector any wake from EM4 must also shut off RF Sense to ensure proper receive functionality.