RF Sense#

Modules#

RAIL_RfSenseSelectiveOokConfig_t

sl_rail_rf_sense_selective_ook_config_t

Enumerations#

enum
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_RFSENSE_ANY_LOW_SENSITIVITY = (0x20U) + RAIL_RFSENSE_ANY
}

An enumeration for specifying the RF Sense frequency band.

enum
SL_RAIL_RF_SENSE_OFF = 0u
SL_RAIL_RF_SENSE_2P4_GHZ = 1u
SL_RAIL_RF_SENSE_SUB_GHZ = 2u
SL_RAIL_RF_SENSE_ANY = 3u
SL_RAIL_RF_SENSE_MAX
SL_RAIL_RF_SENSE_2P4_GHZ_LOW_SENSITIVITY = (0x20U) + SL_RAIL_RF_SENSE_2P4_GHZ
SL_RAIL_RF_SENSE_SUB_GHZ_LOW_SENSITIVITY = (0x20U) + SL_RAIL_RF_SENSE_SUB_GHZ
SL_RAIL_RF_SENSE_ANY_LOW_SENSITIVITY = (0x20U) + SL_RAIL_RF_SENSE_ANY
}

An enumeration for specifying the RF Sense frequency band.

Typedefs#

typedef void(*

A pointer to an RF Sense callback function.

typedef void(*

A pointer to an RF Sense callback function.

Variables#

uint8_t

The RF Sense high-sensitivity threshold value used by the next sl_rail_start_rf_sense() or sl_rail_start_selective_ook_rf_sense() call, when not specifying a low-sensitivity sl_rail_rf_sense_band_t.

uint8_t

The RF Sense low-sensitivity threshold value used by the next sl_rail_start_rf_sense() or sl_rail_start_selective_ook_rf_sense() call, when specifying a low-sensitivity sl_rail_rf_sense_band_t.

Functions#

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_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_ConfigRfSenseSelectiveOokWakeupPhy(RAIL_Handle_t railHandle)

Switch to RF Sense Selective(OOK) PHY.

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.

sl_rail_start_rf_sense(sl_rail_handle_t rail_handle, sl_rail_rf_sense_band_t band, sl_rail_time_t sense_time_us, sl_rail_rf_sense_callback_t cb)

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

sl_rail_start_selective_ook_rf_sense(sl_rail_handle_t rail_handle, sl_rail_rf_sense_selective_ook_config_t *p_config)

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

Switch to RF Sense Selective(OOK) PHY.

sl_rail_set_rf_sense_selective_ook_wakeup_payload(sl_rail_handle_t rail_handle, uint8_t sync_word_bytes, uint32_t sync_word)

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

bool
sl_rail_is_rf_sensed(sl_rail_handle_t rail_handle)

Check whether the RF was sensed.

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.

#define
SL_RAIL_RF_SENSE_LOW_SENSITIVITY_OFFSET (0x20U)

RF Sense low sensitivity offset.

#define
SL_RAIL_RF_SENSE_USE_HW_SYNC_WORD (0U)

Use the MODEM default sync word.

Enumeration Documentation#

RAIL_RfSenseBand_t#

RAIL_RfSenseBand_t

An enumeration for specifying the RF Sense frequency band.

DeprecatedRAIL 2.x synonym of sl_rail_rf_sense_band_t.

Enumerator
RAIL_RFSENSE_OFF

RF Sense is disabled.

RAIL_RFSENSE_2_4GHZ

RF Sense is in 2.4 GHz band.

RAIL_RFSENSE_SUBGHZ

RF Sense is in Sub-GHz band.

RAIL_RFSENSE_ANY

RF Sense is in both bands.

RAIL_RFSENSE_MAX

A count of the basic choices in this enumeration.

RAIL_RFSENSE_2_4GHZ_LOW_SENSITIVITY

RF Sense is in low sensitivity 2.4 GHz band.

RAIL_RFSENSE_SUBGHZ_LOW_SENSITIVITY

RF Sense is in low sensitivity Sub-GHz band.

RAIL_RFSENSE_ANY_LOW_SENSITIVITY

RF Sense is in low sensitivity for both bands.


sl_rail_rf_sense_band_t#

sl_rail_rf_sense_band_t

An enumeration for specifying the RF Sense frequency band.

Enumerator
SL_RAIL_RF_SENSE_OFF

RF Sense is disabled.

SL_RAIL_RF_SENSE_2P4_GHZ

RF Sense is in 2.4 GHz band.

SL_RAIL_RF_SENSE_SUB_GHZ

RF Sense is in Sub-GHz band.

SL_RAIL_RF_SENSE_ANY

RF Sense is in both bands.

SL_RAIL_RF_SENSE_MAX

A count of the basic choices in this enumeration.

SL_RAIL_RF_SENSE_2P4_GHZ_LOW_SENSITIVITY

RF Sense is in low sensitivity 2.4 GHz band.

SL_RAIL_RF_SENSE_SUB_GHZ_LOW_SENSITIVITY

RF Sense is in low sensitivity Sub-GHz band.

SL_RAIL_RF_SENSE_ANY_LOW_SENSITIVITY

RF Sense is in low sensitivity for both bands.


Typedef Documentation#

RAIL_RfSense_CallbackPtr_t#

typedef void(* RAIL_RfSense_CallbackPtr_t) (void) )(void)

A pointer to an RF Sense callback function.

Consider using the event RAIL_EVENT_RF_SENSED as an alternative.

DeprecatedRAIL 2.x synonym of sl_rail_rf_sense_callback_t().


sl_rail_rf_sense_callback_t#

typedef void(* sl_rail_rf_sense_callback_t) (void) )(void)

A pointer to an RF Sense callback function.

Consider using the event SL_RAIL_EVENT_RF_SENSED as an alternative.


Variable Documentation#

sl_rail_rf_sense_high_sensitivity_value#

uint8_t sl_rail_rf_sense_high_sensitivity_value

The RF Sense high-sensitivity threshold value used by the next sl_rail_start_rf_sense() or sl_rail_start_selective_ook_rf_sense() call, when not specifying a low-sensitivity sl_rail_rf_sense_band_t.

The units are platform-dependent and range from 0 (highest sensitivity) to 255 (lowest sensitivity). This should be less than sl_rail_rf_sense_low_sensitivity_value. RAIL initializes this to a default setting.


sl_rail_rf_sense_low_sensitivity_value#

uint8_t sl_rail_rf_sense_low_sensitivity_value

The RF Sense low-sensitivity threshold value used by the next sl_rail_start_rf_sense() or sl_rail_start_selective_ook_rf_sense() call, when specifying a low-sensitivity sl_rail_rf_sense_band_t.

The units are platform-dependent and range from 0 (highest sensitivity) to 255 (lowest sensitivity). This should be greater than sl_rail_rf_sense_high_sensitivity_value. RAIL initializes this to a default setting.


Function Documentation#

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
TypeDirectionArgument NameDescription
RAIL_Handle_t[in]railHandle

A RAIL instance handle.

RAIL_RfSenseBand_t[in]band

The frequency band(s) on which to sense the RF energy. To stop RF Sense, specify RAIL_RFSENSE_OFF.

RAIL_Time_t[in]senseTime

The time (in microseconds) the RF energy must be continually detected to be considered "sensed".

RAIL_RfSense_CallbackPtr_t[in]cb

RAIL_RfSense_CallbackPtr_t() is called when the RF is sensed. Set NULL if using RAIL_EVENT_RF_SENSED or 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 or event will be issued).

Some EFR32 radios have 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. An application can check when RF energy is sensed either by enabling the event RAIL_EVENT_RF_SENSED, by polling on the RAIL_IsRfSensed() API, or by using the cb callback.

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.

Warnings

  • For some radios, RF Sense functionality is only guaranteed within a specified temperature range. See chip-specific documentation for more details.

DeprecatedRAIL 2.x synonym of sl_rail_start_rf_sense().


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
TypeDirectionArgument NameDescription
RAIL_Handle_t[in]railHandle

A RAIL instance handle.

RAIL_RfSenseSelectiveOokConfig_t *[in]config

A pointer to a RAIL_RfSenseSelectiveOokConfig_t which holds the RF Sense configuration for Selective(OOK) mode.

Returns

  • Status code indicating success of the function call.

Some radios support Selective RF energy detection (OOK mode) where the user can program the radio to look for a particular sync word pattern (1-4 bytes) 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.

// Sync word length in bytes, 1-4 bytes.
#define NUM_SYNC_WORD_BYTES (2U)
// Sync word value.
#define SYNC_WORD           (0xB16FU)
// Desired RF band
RAIL_RfSenseBand_t rfBand = RAIL_RFSENSE_2_4GHZ;

// Configure the transmitting node for sending the wakeup packet.
RAIL_Idle(railHandle, RAIL_IDLE_ABORT, true);
RAIL_ConfigRfSenseSelectiveOokWakeupPhy(railHandle);
RAIL_SetRfSenseSelectiveOokWakeupPayload(railHandle, NUM_SYNC_WORD_BYTES, SYNC_WORD);
RAIL_StartTx(railHandle, channel, RAIL_TX_OPTIONS_DEFAULT, NULL);

// Configure the receiving node (EFR32xG22) for RF Sense.
RAIL_RfSenseSelectiveOokConfig_t config = {
 .band = rfBand,
 .syncWordNumBytes = NUM_SYNC_WORD_BYTES,
 .syncWord = SYNC_WORD,
 .cb = NULL // Use RAIL_EVENT_RF_SENSED event or poll RAIL_IsRfSensed()
};
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.

DeprecatedRAIL 2.x synonym of sl_rail_start_selective_ook_rf_sense().


RAIL_ConfigRfSenseSelectiveOokWakeupPhy#

RAIL_Status_t RAIL_ConfigRfSenseSelectiveOokWakeupPhy (RAIL_Handle_t railHandle)

Switch to RF Sense Selective(OOK) PHY.

Parameters
TypeDirectionArgument NameDescription
RAIL_Handle_t[in]railHandle

A handle for RAIL instance.

Returns

  • Status code indicating success of the function call.

This function switches to the RF Sense 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 Sync word (1-4 bytes). See chip-specific documentation for more details.

DeprecatedRAIL 2.x synonym of sl_rail_config_rf_sense_selective_ook_wakeup_phy().


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
TypeDirectionArgument NameDescription
RAIL_Handle_t[in]railHandle

A handle for RAIL instance.

uint8_t[in]numSyncwordBytes

Sync word length in bytes, 1-4 bytes.

uint32_t[in]syncword

Sync word value.

Returns

  • Status code indicating success of the function call.

Note

DeprecatedRAIL 2.x synonym of sl_rail_set_rf_sense_selective_ook_wakeup_payload().


RAIL_IsRfSensed#

bool RAIL_IsRfSensed (RAIL_Handle_t railHandle)

Check whether the RF was sensed.

Parameters
TypeDirectionArgument NameDescription
RAIL_Handle_t[in]railHandle

A RAIL instance handle.

Returns

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.

DeprecatedRAIL 2.x synonym of sl_rail_is_rf_sensed().


sl_rail_start_rf_sense#

sl_rail_time_t sl_rail_start_rf_sense (sl_rail_handle_t rail_handle, sl_rail_rf_sense_band_t band, sl_rail_time_t sense_time_us, sl_rail_rf_sense_callback_t cb)

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

Parameters
TypeDirectionArgument NameDescription
sl_rail_handle_t[in]rail_handle

A radio-generic or real RAIL instance handle.

sl_rail_rf_sense_band_t[in]band

The frequency band(s) on which to sense the RF energy. To stop RF Sense, specify SL_RAIL_RF_SENSE_OFF.

sl_rail_time_t[in]sense_time_us

The time (in microseconds) the RF energy must be continually detected to be considered "sensed".

sl_rail_rf_sense_callback_t[in]cb

sl_rail_rf_sense_callback_t() is called when the RF is sensed. Set NULL if using SL_RAIL_EVENT_RF_SENSED or polling via sl_rail_is_rf_sensed().

Returns

  • The actual sense_time_us 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 or event will be issued).

Some EFR32 radios have 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. An application can check when RF energy is sensed either by enabling the event SL_RAIL_EVENT_RF_SENSED, by polling on the sl_rail_is_rf_sensed() API, or by using the cb callback.

Note

  • After RF energy has been sensed, the RF Sense is automatically disabled and sl_rail_start_rf_sense() must be called again to reactivate it. If RF energy has not been sensed and to manually disable RF Sense, sl_rail_start_rf_sense() must be called with band specified as SL_RAIL_RF_SENSE_OFF or with sense_time_us 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.

Warnings

  • For some radios, RF Sense functionality is only guaranteed within a specified temperature range. See chip-specific documentation for more details.


sl_rail_start_selective_ook_rf_sense#

sl_rail_status_t sl_rail_start_selective_ook_rf_sense (sl_rail_handle_t rail_handle, sl_rail_rf_sense_selective_ook_config_t * p_config)

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

Parameters
TypeDirectionArgument NameDescription
sl_rail_handle_t[in]rail_handle

A real RAIL instance handle.

sl_rail_rf_sense_selective_ook_config_t *[in]p_config

A pointer to a sl_rail_rf_sense_selective_ook_config_t which holds the RF Sense configuration for Selective(OOK) mode.

Returns

  • Status code indicating success of the function call.

Some radios support Selective RF energy detection (OOK mode) where the user can program the radio to look for a particular sync word pattern (1-4 bytes) 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.

// Sync word length in bytes, 1-4 bytes.
#define NUM_SYNC_WORD_BYTES (2U)
// Sync word value.
#define SYNC_WORD           (0xB16FU)
// Desired RF band
sl_rail_rf_sense_band_t rf_band = SL_RAIL_RF_SENSE_2P4_GHZ;

// Configure the transmitting node for sending the wakeup packet.
sl_rail_idle(rail_handle, SL_RAIL_IDLE_ABORT, true);
sl_rail_config_rf_sense_selective_ook_wakeup_phy(rail_handle);
sl_rail_set_rf_sense_selective_ook_wakeup_payload(rail_handle, NUM_SYNC_WORD_BYTES, SYNC_WORD);
sl_rail_start_tx(rail_handle, channel, SL_RAIL_TX_OPTIONS_DEFAULT, NULL);

// Configure the receiving node (EFR32xG22) for RF Sense.
sl_rail_rf_sense_selective_ook_config_t config = {
 .band = rf_band,
 .sync_word_bytes = NUM_SYNC_WORD_BYTES,
 .sync_word = SYNC_WORD,
 .cb = NULL // Use SL_RAIL_EVENT_RF_SENSED event or poll sl_rail_is_rf_sensed()
};
sl_rail_start_selective_ook_rf_sense(rail_handle, &config);

Note

  • After RF energy has been sensed, the RF Sense is automatically disabled and sl_rail_start_selective_ook_rf_sense() must be called again to reactivate. If RF energy has not been sensed and to manually disable RF Sense, sl_rail_start_selective_ook_rf_sense() must be called with band specified as SL_RAIL_RF_SENSE_OFF or with sl_rail_rf_sense_selective_ook_config_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.


sl_rail_config_rf_sense_selective_ook_wakeup_phy#

sl_rail_status_t sl_rail_config_rf_sense_selective_ook_wakeup_phy (sl_rail_handle_t rail_handle)

Switch to RF Sense Selective(OOK) PHY.

Parameters
TypeDirectionArgument NameDescription
sl_rail_handle_t[in]rail_handle

A real RAIL instance handle.

Returns

  • Status code indicating success of the function call.

This function switches to the RF Sense 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 sl_rail_set_rf_sense_selective_ook_wakeup_payload, post this function call to include the first byte as the Preamble byte, followed by the Sync word (1-4 bytes). See chip-specific documentation for more details.


sl_rail_set_rf_sense_selective_ook_wakeup_payload#

sl_rail_status_t sl_rail_set_rf_sense_selective_ook_wakeup_payload (sl_rail_handle_t rail_handle, uint8_t sync_word_bytes, uint32_t sync_word)

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

Parameters
TypeDirectionArgument NameDescription
sl_rail_handle_t[in]rail_handle

A real RAIL instance handle.

uint8_t[in]sync_word_bytes

Sync word length in bytes, 1-4 bytes.

uint32_t[in]sync_word

Sync word value.

Returns

  • Status code indicating success of the function call.

Note


sl_rail_is_rf_sensed#

bool sl_rail_is_rf_sensed (sl_rail_handle_t rail_handle)

Check whether the RF was sensed.

Parameters
TypeDirectionArgument NameDescription
sl_rail_handle_t[in]rail_handle

A radio-generic or real RAIL instance handle.

Returns

This function is useful if sl_rail_start_rf_sense() is called with a NULL callback. It is generally used after EM4 reboot but can be used any time.