State Transitions#
Modules#
Enumerations#
The state of the radio.
The detailed state of the radio.
An enumeration for the different types of supported idle modes.
The state of the radio.
The detailed state of the radio.
An enumeration for the different types of supported idle modes.
Typedefs#
Suitable type for the supported transition time range.
Suitable type for the supported transition time range.
Functions#
Configure RAIL automatic state transitions after RX.
Get the current RAIL automatic state transitions after RX.
Configure RAIL automatic state transitions after TX.
Get the current RAIL automatic state transitions after TX.
Set up automatic repeated transmits after the next transmit.
Get the number of transmits remaining in a repeat operation.
Configure RAIL automatic state transition timing.
Place the radio into an idle state.
Get the current radio state.
Get the detailed current radio state.
Enable/disable caching of synth calibration value.
Configure RAIL automatic state transitions after RX.
Get the current RAIL automatic state transitions after RX.
Configure RAIL automatic state transitions after TX.
Get the current RAIL automatic state transitions after TX.
Set up automatic repeated transmits after the next transmit.
Get the number of transmits remaining in a repeat operation.
Configure RAIL automatic state transition timing.
Place the radio into an idle state.
Get the current radio state.
Get the detailed current radio state.
Enable/disable caching of synth calibration value.
Macros#
A value to use in RAIL_StateTiming_t fields when calling RAIL_SetStateTiming() to keep that timing parameter at it current setting.
Radio is inactive.
Radio is in or headed to the idle state.
Radio is in or headed to the receive state.
Radio is in or headed to the transmit state.
Radio is headed to the idle, receive, or transmit state.
Radio is actively transmitting or receiving.
Radio has frame detect disabled.
LBT/CSMA operation is currently ongoing.
Mask for core radio state bits.
A value to use in sl_rail_state_timing_t fields when calling sl_rail_set_state_timing() to keep that timing parameter at it current setting.
Radio is inactive.
Radio is in or headed to the idle state.
Radio is in or headed to the receive state.
Radio is in or headed to the transmit state.
Radio is headed to the idle, receive, or transmit state.
Radio is actively transmitting or receiving.
Radio has frame detect disabled.
LBT/CSMA operation is currently ongoing.
Mask for core radio state bits.
Enumeration Documentation#
RAIL_RadioState_t#
RAIL_RadioState_t
The state of the radio.
DeprecatedRAIL 2.x synonym of sl_rail_radio_state_t.
| Enumerator | |
|---|---|
| RAIL_RF_STATE_INACTIVE | Radio is inactive. |
| RAIL_RF_STATE_ACTIVE | Radio is either idle or, in combination with the RX and TX states, receiving or transmitting a frame. |
| RAIL_RF_STATE_RX | Radio is in receive. |
| RAIL_RF_STATE_TX | Radio is in transmit. |
| RAIL_RF_STATE_IDLE | Radio is idle. |
| RAIL_RF_STATE_RX_ACTIVE | Radio is actively receiving a frame. |
| RAIL_RF_STATE_TX_ACTIVE | Radio is actively transmitting a frame. |
RAIL_RadioStateDetail_t#
RAIL_RadioStateDetail_t
The detailed state of the radio.
The three radio state bits RAIL_RF_STATE_DETAIL_IDLE_STATE, RAIL_RF_STATE_DETAIL_RX_STATE, and RAIL_RF_STATE_DETAIL_TX_STATE comprise a set of mutually exclusive core radio states. Only one (or none) of these bits can be set at a time. Otherwise, the value is invalid.
The precise meaning of each of these three core bits, when set, depends on the value of the two bits RAIL_RF_STATE_DETAIL_TRANSITION and RAIL_RF_STATE_DETAIL_ACTIVE. When RAIL_RF_STATE_DETAIL_TRANSITION is set, the radio is transitioning into the core radio state corresponding to the set state bit. When it is clear, the radio is already in the core radio state that corresponds to the set state bit. When RAIL_RF_STATE_DETAIL_ACTIVE is set, the radio is actively transmitting or receiving. When it is clear, the radio is not actively transmitting or receiving. This bit will always be clear when RAIL_RF_STATE_DETAIL_IDLE_STATE is set, and will always be set when RAIL_RF_STATE_DETAIL_TX_STATE is set. Otherwise, the value is invalid.
The bit RAIL_RF_STATE_DETAIL_NO_FRAMES is set if the radio is currently operating with frame detection disabled, and clear otherwise. The bit RAIL_RF_STATE_DETAIL_LBT_SHIFT is set if an LBT/CSMA operation (e.g., performing CCA) is currently ongoing, and clear otherwise.
DeprecatedRAIL 2.x synonym of sl_rail_radio_state_detail_t.
| Enumerator | |
|---|---|
| RAIL_RF_STATE_DETAIL_IDLE_STATE_SHIFT | Shift position of RAIL_RF_STATE_DETAIL_IDLE_STATE bit. |
| RAIL_RF_STATE_DETAIL_RX_STATE_SHIFT | Shift position of RAIL_RF_STATE_DETAIL_RX_STATE bit. |
| RAIL_RF_STATE_DETAIL_TX_STATE_SHIFT | Shift position of RAIL_RF_STATE_DETAIL_TX_STATE bit. |
| RAIL_RF_STATE_DETAIL_TRANSITION_SHIFT | Shift position of RAIL_RF_STATE_DETAIL_TRANSITION bit. |
| RAIL_RF_STATE_DETAIL_ACTIVE_SHIFT | Shift position of RAIL_RF_STATE_DETAIL_ACTIVE bit. |
| RAIL_RF_STATE_DETAIL_NO_FRAMES_SHIFT | Shift position of RAIL_RF_STATE_DETAIL_NO_FRAMES bit. |
| RAIL_RF_STATE_DETAIL_LBT_SHIFT | Shift position of RAIL_RF_STATE_DETAIL_LBT bit. |
RAIL_IdleMode_t#
RAIL_IdleMode_t
An enumeration for the different types of supported idle modes.
These vary how quickly and destructively they put the radio into idle.
DeprecatedRAIL 2.x synonym of sl_rail_idle_mode_t.
| Enumerator | |
|---|---|
| RAIL_IDLE | Idle the radio by turning off receive and canceling any future scheduled receive or transmit operations. |
| RAIL_IDLE_ABORT | Idle the radio by turning off receive and any scheduled events. |
| RAIL_IDLE_FORCE_SHUTDOWN | Force the radio into a shutdown mode by stopping whatever state is in progress. |
| RAIL_IDLE_FORCE_SHUTDOWN_CLEAR_FLAGS | Similar to the RAIL_IDLE_FORCE_SHUTDOWN command, however, it will also clear any pending RAIL events related to receive and transmit. |
sl_rail_radio_state_t#
sl_rail_radio_state_t
The state of the radio.
| Enumerator | |
|---|---|
| SL_RAIL_RF_STATE_INACTIVE | Radio is inactive. |
| SL_RAIL_RF_STATE_ACTIVE | Radio is either idle or, in combination with the RX and TX states, receiving or transmitting a frame. |
| SL_RAIL_RF_STATE_RX | Radio is in receive. |
| SL_RAIL_RF_STATE_TX | Radio is in transmit. |
| SL_RAIL_RF_STATE_IDLE | Radio is idle. |
| SL_RAIL_RF_STATE_RX_ACTIVE | Radio is actively receiving a frame. |
| SL_RAIL_RF_STATE_TX_ACTIVE | Radio is actively transmitting a frame. |
sl_rail_radio_state_detail_t#
sl_rail_radio_state_detail_t
The detailed state of the radio.
The three radio state bits SL_RAIL_RF_STATE_DETAIL_IDLE_STATE, SL_RAIL_RF_STATE_DETAIL_RX_STATE, and SL_RAIL_RF_STATE_DETAIL_TX_STATE comprise a set of mutually exclusive core radio states. Only one (or none) of these bits can be set at a time. Otherwise, the value is invalid.
The precise meaning of each of these three core bits, when set, depends on the value of the two bits SL_RAIL_RF_STATE_DETAIL_TRANSITION and SL_RAIL_RF_STATE_DETAIL_ACTIVE. When SL_RAIL_RF_STATE_DETAIL_TRANSITION is set, the radio is transitioning into the core radio state corresponding to the set state bit. When it is clear, the radio is already in the core radio state that corresponds to the set state bit. When SL_RAIL_RF_STATE_DETAIL_ACTIVE is set, the radio is actively transmitting or receiving. When it is clear, the radio is not actively transmitting or receiving. This bit will always be clear when SL_RAIL_RF_STATE_DETAIL_IDLE_STATE is set, and will always be set when SL_RAIL_RF_STATE_DETAIL_TX_STATE is set. Otherwise, the value is invalid.
The bit SL_RAIL_RF_STATE_DETAIL_NO_FRAMES is set if the radio is currently operating with frame detection disabled, and clear otherwise. The bit SL_RAIL_RF_STATE_DETAIL_LBT_SHIFT is set if an LBT/CSMA operation (e.g., performing CCA) is currently ongoing, and clear otherwise.
| Enumerator | |
|---|---|
| SL_RAIL_RF_STATE_DETAIL_IDLE_STATE_SHIFT | Shift position of SL_RAIL_RF_STATE_DETAIL_IDLE_STATE bit. |
| SL_RAIL_RF_STATE_DETAIL_RX_STATE_SHIFT | Shift position of SL_RAIL_RF_STATE_DETAIL_RX_STATE bit. |
| SL_RAIL_RF_STATE_DETAIL_TX_STATE_SHIFT | Shift position of SL_RAIL_RF_STATE_DETAIL_TX_STATE bit. |
| SL_RAIL_RF_STATE_DETAIL_TRANSITION_SHIFT | Shift position of SL_RAIL_RF_STATE_DETAIL_TRANSITION bit. |
| SL_RAIL_RF_STATE_DETAIL_ACTIVE_SHIFT | Shift position of SL_RAIL_RF_STATE_DETAIL_ACTIVE bit. |
| SL_RAIL_RF_STATE_DETAIL_NO_FRAMES_SHIFT | Shift position of SL_RAIL_RF_STATE_DETAIL_NO_FRAMES bit. |
| SL_RAIL_RF_STATE_DETAIL_LBT_SHIFT | Shift position of SL_RAIL_RF_STATE_DETAIL_LBT bit. |
sl_rail_idle_mode_t#
sl_rail_idle_mode_t
An enumeration for the different types of supported idle modes.
These vary how quickly and destructively they put the radio into idle.
| Enumerator | |
|---|---|
| SL_RAIL_IDLE | Idle the radio by turning off receive and canceling any future scheduled receive or transmit operations. |
| SL_RAIL_IDLE_ABORT | Idle the radio by turning off receive and any scheduled events. |
| SL_RAIL_IDLE_FORCE_SHUTDOWN | Force the radio into a shutdown mode by stopping whatever state is in progress. |
| SL_RAIL_IDLE_FORCE_SHUTDOWN_CLEAR_FLAGS | Similar to the SL_RAIL_IDLE_FORCE_SHUTDOWN command, however, it will also clear any pending RAIL events related to receive and transmit. |
Typedef Documentation#
RAIL_TransitionTime_t#
RAIL_TransitionTime_t
Suitable type for the supported transition time range.
Refer to platform-specific RAIL_MINIMUM_TRANSITION_US and RAIL_MAXIMUM_TRANSITION_US for the valid range of this type.
DeprecatedRAIL 2.x synonym of sl_rail_transition_time_t.
sl_rail_transition_time_t#
sl_rail_transition_time_t
Suitable type for the supported transition time range.
Refer to platform-specific SL_RAIL_MINIMUM_TRANSITION_US and SL_RAIL_MAXIMUM_TRANSITION_US for the valid range of this type.
Function Documentation#
RAIL_SetRxTransitions#
RAIL_Status_t RAIL_SetRxTransitions (RAIL_Handle_t railHandle, const RAIL_StateTransitions_t * transitions)
Configure RAIL automatic state transitions after RX.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
| const RAIL_StateTransitions_t * | [in] | transitions | A pointer to the state transitions to apply after reception. |
Returns
Status code indicating success of the function call.
This function fails if unsupported transitions are passed in or if the radio is currently in the RX state. Success can transition to TX, RX, or IDLE, while error can transition to RX or IDLE. The timings of state transitions from the RX state are not guaranteed when packets are longer than 16 seconds on-air.
DeprecatedRAIL 2.x synonym of sl_rail_set_rx_transitions().
RAIL_GetRxTransitions#
RAIL_Status_t RAIL_GetRxTransitions (RAIL_Handle_t railHandle, RAIL_StateTransitions_t * transitions)
Get the current RAIL automatic state transitions after RX.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
| RAIL_StateTransitions_t * | [out] | transitions | A pointer to the state transitions that RAIL applies after receive. |
Returns
Status code indicating a success of the function call.
Retrieves the current state transitions after RX and stores them in the transitions argument.
DeprecatedRAIL 2.x synonym of sl_rail_get_rx_transitions().
RAIL_SetTxTransitions#
RAIL_Status_t RAIL_SetTxTransitions (RAIL_Handle_t railHandle, const RAIL_StateTransitions_t * transitions)
Configure RAIL automatic state transitions after TX.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
| const RAIL_StateTransitions_t * | [in] | transitions | A pointer to the state transitions to apply after transmission. |
Returns
Status code indicating a success of the function call.
This function fails if unsupported transitions are passed in or if the radio is currently in the TX state. Success and error can each transition to RX or IDLE only, not TX. For the ability to run repeated transmits, see RAIL_SetNextTxRepeat(). Calling this function will clear any repeated transmissions set up by RAIL_SetNextTxRepeat().
DeprecatedRAIL 2.x synonym of sl_rail_set_tx_transitions().
RAIL_GetTxTransitions#
RAIL_Status_t RAIL_GetTxTransitions (RAIL_Handle_t railHandle, RAIL_StateTransitions_t * transitions)
Get the current RAIL automatic state transitions after TX.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
| RAIL_StateTransitions_t * | [out] | transitions | A pointer to the state transitions that RAIL applies after transmission. |
Returns
Status code indicating a success of the function call.
Retrieves the current state transitions after TX and stores them in the transitions argument.
DeprecatedRAIL 2.x synonym of sl_rail_get_tx_transitions().
RAIL_SetNextTxRepeat#
RAIL_Status_t RAIL_SetNextTxRepeat (RAIL_Handle_t railHandle, const RAIL_TxRepeatConfig_t * repeatConfig)
Set up automatic repeated transmits after the next transmit.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
| const RAIL_TxRepeatConfig_t * | [in] | repeatConfig | A pointer to the configuration structure for repeated transmits. |
Returns
Status code indicating a success of the function call.
Repeated transmits will occur after an application-initiated transmit caused by calling one of the Packet Transmit APIs. The repetition will only occur after the first application-initiated transmit after this function is called. Future repeated transmits must be requested by calling this function again.
Each repeated transmit that occurs will have full PTI Packet Trace information, and will receive events such as RAIL_EVENT_TX_PACKET_SENT as normal.
If a TX error occurs during the repetition, the process will abort and the TX error transition from RAIL_SetTxTransitions() will be used. If the repetition completes successfully, then the TX success transition from RAIL_SetTxTransitions() will be used.
Use RAIL_GetTxPacketsRemaining() if need to know how many transmit completion events are expected before the repeating sequence is done, or how many were not performed due to a transmit error.
Any call to RAIL_Idle(), RAIL_StopTx(), or RAIL_SetTxTransitions() will clear the pending repeated transmits. The state will also be cleared by another call to this function. A DMP switch will clear this state only if the initial transmit triggering the repeated transmits has started.
One can change the repeated transmit configuration by re-calling this function with new parameters as long as that occurs prior to calling a Packet Transmit API. Passing a RAIL_TxRepeatConfig_t::iterations count of 0 will prevent the next transmit from repeating.
The application is responsible for populating the transmit data to be used by the repeated transmits via RAIL_SetTxFifo() or RAIL_WriteTxFifo(). Data will be transmitted from the transmit FIFO. If the transmit FIFO does not have sufficient data to transmit, a TX error will be caused and a RAIL_EVENT_TX_UNDERFLOW will occur. In order to avoid an underflow, the application should queue data to be transmitted as early as possible. Consider using RAIL_TX_OPTION_RESEND if the same packet data is to be repeated: then the transmit FIFO only needs to be set/written once.
Do not call this function after starting a transmit operation via a Packet Transmit API call or before processing the final transmit completion event of a prior transmit. This function will fail to (re)configure the repetition if a transmit of any kind is ongoing, including during the time between an initial transmit and the end of a previously-configured repetition.
Note
Use the compile time symbol RAIL_SUPPORTS_TX_TO_TX or the runtime call RAIL_SupportsTxToTx() to check whether the platform supports this feature.
DeprecatedRAIL 2.x synonym of sl_rail_set_next_tx_repeat().
RAIL_GetTxPacketsRemaining#
uint16_t RAIL_GetTxPacketsRemaining (RAIL_Handle_t railHandle)
Get the number of transmits remaining in a repeat operation.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
Must only be called from within event callback context when handling one of the RAIL_EVENTS_TX_COMPLETION events.
Returns
transmits remaining as described below.
If the TX completion event is RAIL_EVENT_TX_PACKET_SENT the returned value indicates how many more such events are expected before the repeat transmit operation is done. Due to interrupt latency and timing, this may be an overcount if greater than 0 but is guaranteed to be accurate when 0.
If the TX completion event is an error, the returned value indicates the number of requested transmits that were not performed. For RAIL_EVENT_TX_ABORTED and RAIL_EVENT_TX_UNDERFLOW the count does not include the failing transmit itself. For the other errors where a transmit never started or was blocked, the count would include the failing transmit, which may be one higher than the configured RAIL_TxRepeatConfig_t::iterations if it was the original transmit that was blocked.
If an infinite repeat was configured, this will return RAIL_TX_REPEAT_INFINITE_ITERATIONS.
DeprecatedRAIL 2.x synonym of sl_rail_get_tx_packets_remaining().
RAIL_SetStateTiming#
RAIL_Status_t RAIL_SetStateTiming (RAIL_Handle_t railHandle, RAIL_StateTiming_t * timings)
Configure RAIL automatic state transition timing.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
| RAIL_StateTiming_t * | [inout] | timings | A pointer to the timings used to configure the RAIL state machine. This structure is updated with the actual times that were set, if an input timing is invalid. |
Returns
Status code indicating a success of the function call.
The timings given are close to the actual transition time. However, a still uncharacterized software overhead occurs. Also, timings are not always adhered to when using an automatic transition after an error, due to the cleanup required to recover from the error.
DeprecatedRAIL 2.x synonym of sl_rail_set_state_timing().
RAIL_Idle#
RAIL_Status_t RAIL_Idle (RAIL_Handle_t railHandle, RAIL_IdleMode_t mode, bool wait)
Place the radio into an idle state.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
| RAIL_IdleMode_t | [in] | mode | The method for shutting down the radio. |
| bool | [in] | wait | Whether this function should wait for the radio to reach idle before returning. |
Returns
RAIL_STATUS_NO_ERROR if the radio has idled by the time this function returns, or RAIL_STATUS_SUSPENDED if it is still in the process of idling.
This function is used to remove the radio from TX and RX states. How these states are left is defined by the mode parameter.
In multiprotocol, this API will also cause the radio to be yielded so that other tasks can be run. See Yielding the Radio for more details.
DeprecatedRAIL 2.x synonym of sl_rail_idle().
RAIL_GetRadioState#
RAIL_RadioState_t RAIL_GetRadioState (RAIL_Handle_t railHandle)
Get the current radio state.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
Returns
An enumeration for the current radio state.
Returns the state of the radio as a bitmask containing: RAIL_RF_STATE_IDLE, RAIL_RF_STATE_RX, RAIL_RF_STATE_TX, and RAIL_RF_STATE_ACTIVE. RAIL_RF_STATE_IDLE, RAIL_RF_STATE_RX, and RAIL_RF_STATE_TX bits are mutually exclusive. The radio can transition through intermediate states, which are not reported but are instead considered part of the state most closely associated. For example, when the radio is warming up or shutting down the transmitter or receiver, this function returns RAIL_RF_STATE_TX or RAIL_RF_STATE_RX, respectively. When transitioning directly from RX to TX or vice-versa, this function returns the earlier state.
Note
For a more detailed radio state, see RAIL_GetRadioStateDetail().
DeprecatedRAIL 2.x synonym of sl_rail_get_radio_state().
RAIL_GetRadioStateDetail#
RAIL_RadioStateDetail_t RAIL_GetRadioStateDetail (RAIL_Handle_t railHandle)
Get the detailed current radio state.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
Returns
An enumeration for the current detailed radio state.
Returns the state of the radio as a bitmask. The three core radio states IDLE, RX, and TX are represented by mutually exclusive bits RAIL_RF_STATE_DETAIL_IDLE_STATE, RAIL_RF_STATE_DETAIL_RX_STATE, and RAIL_RF_STATE_DETAIL_TX_STATE respectively. If the radio is transitioning between these three states, the returned bitmask will have RAIL_RF_STATE_DETAIL_TRANSITION set along with a bit corresponding to the destination core radio state. If, while in the receive state, the radio is actively receiving a packet, RAIL_RF_STATE_DETAIL_ACTIVE will be set; otherwise, this bit will be clear. If frame detection is disabled, RAIL_RF_STATE_DETAIL_NO_FRAMES in the returned state bitmask will be set; otherwise, this bit will be clear. If the radio is performing an LBT/CSMA operation (e.g., a backoff period) RAIL_RF_STATE_DETAIL_LBT in the returned state bitmask will be set; otherwise, this bit will be clear.
For the most part, the more detailed radio states returned by this API correspond to radio states returned by RAIL_GetRadioState() as follows:
RAIL_RadioStateDetail_tRAIL_RadioState_t RAIL_RF_STATE_DETAIL_INACTIVE RAIL_RF_STATE_INACTIVE RAIL_RF_STATE_DETAIL_IDLE_STATE | RAIL_STATE_DETAIL_TRANSITION If RX overflow or leaving RX unforced: RAIL_RF_STATE_RX Else if leaving TX unforced: RAIL_RF_STATE_TX Else: RAIL_RF_STATE_IDLE RAIL_RF_STATE_DETAIL_IDLE_STATE RAIL_RF_STATE_IDLE RAIL_RF_STATE_DETAIL_IDLE_STATE | RAIL_STATE_DETAIL_LBT RAIL_RF_STATE_TX RAIL_RF_STATE_DETAIL_RX_STATE | RAIL_STATE_DETAIL_TRANSITION If leaving TX: RAIL_RF_STATE_TX Else: RAIL_RF_STATE_RX RAIL_RF_STATE_DETAIL_RX_STATE | RAIL_RF_STATE_DETAIL_TRANSITION | RAIL_RF_STATE_DETAIL_NO_FRAMES If leaving TX: RAIL_RF_STATE_TX Else: RAIL_RF_STATE_RX RAIL_RF_STATE_DETAIL_RX_STATE RAIL_RF_STATE_RX RAIL_RF_STATE_DETAIL_RX_STATE | RAIL_RF_STATE_DETAIL_NO_FRAMES RAIL_RF_STATE_RX RAIL_RF_STATE_DETAIL_RX_STATE | RAIL_RF_STATE_DETAIL_LBT RAIL_RF_STATE_RX RAIL_RF_STATE_DETAIL_RX_STATE | RAIL_RF_STATE_DETAIL_NO_FRAMES | RAIL_RF_STATE_DETAIL_LBT RAIL_RF_STATE_RX RAIL_RF_STATE_DETAIL_RX_STATE | RAIL_RF_STATE_DETAIL_ACTIVE RAIL_RF_STATE_RX_ACTIVE RAIL_RF_STATE_DETAIL_TX_STATE | RAIL_RF_STATE_TRANSITION If leaving RX: RAIL_RF_STATE_RX Else: RAIL_RF_STATE_TX RAIL_RF_STATE_DETAIL_TX_STATE | RAIL_RF_STATE_ACTIVE RAIL_RF_STATE_TX_ACTIVE
DeprecatedRAIL 2.x synonym of sl_rail_get_radio_state_detail().
RAIL_EnableCacheSynthCal#
RAIL_Status_t RAIL_EnableCacheSynthCal (RAIL_Handle_t railHandle, bool enable)
Enable/disable caching of synth calibration value.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
| bool | [in] | enable | A boolean to enable or disable caching of synth calibration. |
Returns
Status code indicating success of the function call.
Once enabled, the sequencer will start caching synth calibration values for channels and apply them instead of performing calibration on every state transition and channel change. This will increase the transition time for the first time calibration is performed. Subsequent state transitions will be faster. The cache size is 2. RAIL_IEEE802154_SUPPORTS_RX_CHANNEL_SWITCHING internally uses this feature and there is no need to enable/disable it. This function returns RAIL_STATUS_INVALID_STATE if we try to disable it while RAIL_IEEE802154_SUPPORTS_RX_CHANNEL_SWITCHING is enabled.
Note
This function will improve the minimum timings that can be achieved in RAIL_StateTiming_t::idleToRx, RAIL_StateTiming_t::idleToTx, RAIL_StateTiming_t::rxToTx, RAIL_StateTiming_t::txToRx and RAIL_StateTiming_t::txToTx. A call to RAIL_SetStateTiming() is needed to achieve lower transition times.
On a protocol switch the cache is cleared, so it is not suitable for applications where a protocol switch happens frequently, like with Dynamic Multiprotocol.
DeprecatedRAIL 2.x synonym of sl_rail_enable_cache_synth_cal().
sl_rail_set_rx_transitions#
sl_rail_status_t sl_rail_set_rx_transitions (sl_rail_handle_t rail_handle, const sl_rail_state_transitions_t * p_transitions)
Configure RAIL automatic state transitions after RX.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A real RAIL instance handle. |
| const sl_rail_state_transitions_t * | [in] | p_transitions | A pointer to the state transitions to apply after reception. |
Returns
Status code indicating success of the function call.
This function fails if unsupported transitions are passed in or if the radio is currently in the RX state. Success can transition to TX, RX, or IDLE, while error can transition to RX or IDLE. The timings of state transitions from the RX state are not guaranteed when packets are longer than 16 seconds on-air.
sl_rail_get_rx_transitions#
sl_rail_status_t sl_rail_get_rx_transitions (sl_rail_handle_t rail_handle, sl_rail_state_transitions_t * p_transitions)
Get the current RAIL automatic state transitions after RX.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A real RAIL instance handle. |
| sl_rail_state_transitions_t * | [out] | p_transitions | A pointer to the state transitions that RAIL applies after receive. |
Returns
Status code indicating a success of the function call.
Retrieves the current state transitions after RX and stores them in the transitions argument.
sl_rail_set_tx_transitions#
sl_rail_status_t sl_rail_set_tx_transitions (sl_rail_handle_t rail_handle, const sl_rail_state_transitions_t * p_transitions)
Configure RAIL automatic state transitions after TX.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A real RAIL instance handle. |
| const sl_rail_state_transitions_t * | [in] | p_transitions | A pointer to the state transitions to apply after transmission. |
Returns
Status code indicating a success of the function call.
This function fails if unsupported transitions are passed in or if the radio is currently in the TX state. Success and error can each transition to RX or IDLE only, not TX. For the ability to run repeated transmits, see sl_rail_set_next_tx_repeat(). Calling this function will clear any repeated transmissions set up by sl_rail_set_next_tx_repeat().
sl_rail_get_tx_transitions#
sl_rail_status_t sl_rail_get_tx_transitions (sl_rail_handle_t rail_handle, sl_rail_state_transitions_t * p_transitions)
Get the current RAIL automatic state transitions after TX.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A real RAIL instance handle. |
| sl_rail_state_transitions_t * | [out] | p_transitions | A pointer to the state transitions that RAIL applies after transmission. |
Returns
Status code indicating a success of the function call.
Retrieves the current state transitions after TX and stores them in the transitions argument.
sl_rail_set_next_tx_repeat#
sl_rail_status_t sl_rail_set_next_tx_repeat (sl_rail_handle_t rail_handle, const sl_rail_tx_repeat_config_t * p_repeat_config)
Set up automatic repeated transmits after the next transmit.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A real RAIL instance handle. |
| const sl_rail_tx_repeat_config_t * | [in] | p_repeat_config | A pointer to the configuration structure for repeated transmits. |
Returns
Status code indicating a success of the function call.
Repeated transmits will occur after an application-initiated transmit caused by calling one of the Packet Transmit APIs. The repetition will only occur after the first application-initiated transmit after this function is called. Future repeated transmits must be requested by calling this function again.
Each repeated transmit that occurs will have full PTI Packet Trace information, and will receive events such as SL_RAIL_EVENT_TX_PACKET_SENT as normal.
If a TX error occurs during the repetition, the process will abort and the TX error transition from sl_rail_set_tx_transitions() will be used. If the repetition completes successfully, then the TX success transition from sl_rail_set_tx_transitions() will be used.
Use sl_rail_get_tx_packets_remaining() if need to know how many transmit completion events are expected before the repeating sequence is done, or how many were not performed due to a transmit error.
Any call to sl_rail_idle(), sl_rail_stop_tx(), or sl_rail_set_tx_transitions() will clear the pending repeated transmits. The state will also be cleared by another call to this function. A DMP switch will clear this state only if the initial transmit triggering the repeated transmits has started.
One can change the repeated transmit configuration by re-calling this function with new parameters as long as that occurs prior to calling a Packet Transmit API. Passing a sl_rail_tx_repeat_config_t::iterations count of 0 will prevent the next transmit from repeating.
The application is responsible for populating the transmit data to be used by the repeated transmits via sl_rail_set_tx_fifo() or sl_rail_write_tx_fifo(). Data will be transmitted from the transmit FIFO. If the transmit FIFO does not have sufficient data to transmit, a TX error will be caused and a SL_RAIL_EVENT_TX_UNDERFLOW will occur. In order to avoid an underflow, the application should queue data to be transmitted as early as possible. Consider using SL_RAIL_TX_OPTION_RESEND if the same packet data is to be repeated: then the transmit FIFO only needs to be set/written once.
Do not call this function after starting a transmit operation via a Packet Transmit API call or before processing the final transmit completion event of a prior transmit. This function will fail to (re)configure the repetition if a transmit of any kind is ongoing, including during the time between an initial transmit and the end of a previously-configured repetition.
Note
Use the compile time symbol SL_RAIL_SUPPORTS_TX_TO_TX or the runtime call sl_rail_supports_tx_to_tx() to check whether the platform supports this feature.
sl_rail_get_tx_packets_remaining#
uint16_t sl_rail_get_tx_packets_remaining (sl_rail_handle_t rail_handle)
Get the number of transmits remaining in a repeat operation.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A real RAIL instance handle. |
Must only be called from within event callback context when handling one of the SL_RAIL_EVENTS_TX_COMPLETION events.
Returns
transmits remaining as described below.
If the TX completion event is SL_RAIL_EVENT_TX_PACKET_SENT the returned value indicates how many more such events are expected before the repeat transmit operation is done. Due to interrupt latency and timing, this may be an overcount if greater than 0 but is guaranteed to be accurate when 0.
If the TX completion event is an error, the returned value indicates the number of requested transmits that were not performed. For SL_RAIL_EVENT_TX_ABORTED and SL_RAIL_EVENT_TX_UNDERFLOW the count does not include the failing transmit itself. For the other errors where a transmit never started or was blocked, the count would include the failing transmit, which may be one higher than the configured sl_rail_tx_repeat_config_t::iterations if it was the original transmit that was blocked.
If an infinite repeat was configured, this will return SL_RAIL_TX_REPEAT_INFINITE_ITERATIONS.
sl_rail_set_state_timing#
sl_rail_status_t sl_rail_set_state_timing (sl_rail_handle_t rail_handle, sl_rail_state_timing_t * p_timings)
Configure RAIL automatic state transition timing.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A real RAIL instance handle. |
| sl_rail_state_timing_t * | [inout] | p_timings | A pointer to the timings used to configure the RAIL state machine. This structure is updated with the actual times that were set, if an input timing is invalid. |
Returns
Status code indicating a success of the function call.
The timings given are close to the actual transition time. However, a still uncharacterized software overhead occurs. Also, timings are not always adhered to when using an automatic transition after an error, due to the cleanup required to recover from the error.
sl_rail_idle#
sl_rail_status_t sl_rail_idle (sl_rail_handle_t rail_handle, sl_rail_idle_mode_t mode, bool wait)
Place the radio into an idle state.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A real RAIL instance handle. |
| sl_rail_idle_mode_t | [in] | mode | The method for shutting down the radio. |
| bool | [in] | wait | Whether this function should wait for the radio to reach idle before returning. |
Returns
SL_RAIL_STATUS_NO_ERROR if the radio has idled by the time this function returns, or SL_RAIL_STATUS_SUSPENDED if it is still in the process of idling.
This function is used to remove the radio from TX and RX states. How these states are left is defined by the mode parameter.
In multiprotocol, this API will also cause the radio to be yielded so that other tasks can be run. See Yielding the Radio for more details.
sl_rail_get_radio_state#
sl_rail_radio_state_t sl_rail_get_radio_state (sl_rail_handle_t rail_handle)
Get the current radio state.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A real RAIL instance handle. |
Returns
An enumeration for the current radio state.
Returns the state of the radio as a bitmask containing: SL_RAIL_RF_STATE_IDLE, SL_RAIL_RF_STATE_RX, SL_RAIL_RF_STATE_TX, and SL_RAIL_RF_STATE_ACTIVE. SL_RAIL_RF_STATE_IDLE, SL_RAIL_RF_STATE_RX, and SL_RAIL_RF_STATE_TX bits are mutually exclusive. The radio can transition through intermediate states, which are not reported but are instead considered part of the state most closely associated. For example, when the radio is warming up or shutting down the transmitter or receiver, this function returns SL_RAIL_RF_STATE_TX or SL_RAIL_RF_STATE_RX, respectively. When transitioning directly from RX to TX or vice-versa, this function returns the earlier state.
Note
For a more detailed radio state, see sl_rail_get_radio_state_detail().
sl_rail_get_radio_state_detail#
sl_rail_radio_state_detail_t sl_rail_get_radio_state_detail (sl_rail_handle_t rail_handle)
Get the detailed current radio state.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A real RAIL instance handle. |
Returns
An enumeration for the current detailed radio state.
Returns the state of the radio as a bitmask. The three core radio states IDLE, RX, and TX are represented by mutually exclusive bits SL_RAIL_RF_STATE_DETAIL_IDLE_STATE, SL_RAIL_RF_STATE_DETAIL_RX_STATE, and SL_RAIL_RF_STATE_DETAIL_TX_STATE respectively. If the radio is transitioning between these three states, the returned bitmask will have SL_RAIL_RF_STATE_DETAIL_TRANSITION set along with a bit corresponding to the destination core radio state. If, while in the receive state, the radio is actively receiving a packet, SL_RAIL_RF_STATE_DETAIL_ACTIVE will be set; otherwise, this bit will be clear. If frame detection is disabled, SL_RAIL_RF_STATE_DETAIL_NO_FRAMES in the returned state bitmask will be set; otherwise, this bit will be clear. If the radio is performing an LBT/CSMA operation (e.g., a backoff period) SL_RAIL_RF_STATE_DETAIL_LBT in the returned state bitmask will be set; otherwise, this bit will be clear.
For the most part, the more detailed radio states returned by this API correspond to radio states returned by sl_rail_get_radio_state() as follows:
sl_rail_radio_state_detail_tsl_rail_radio_state_t SL_RAIL_RF_STATE_DETAIL_INACTIVE SL_RAIL_RF_STATE_INACTIVE SL_RAIL_RF_STATE_DETAIL_IDLE_STATE | SL_RAIL_STATE_DETAIL_TRANSITION If RX overflow or leaving RX unforced: SL_RAIL_RF_STATE_RX Else if leaving TX unforced: SL_RAIL_RF_STATE_TX Else: SL_RAIL_RF_STATE_IDLE SL_RAIL_RF_STATE_DETAIL_IDLE_STATE SL_RAIL_RF_STATE_IDLE SL_RAIL_RF_STATE_DETAIL_IDLE_STATE | SL_RAIL_STATE_DETAIL_LBT SL_RAIL_RF_STATE_TX SL_RAIL_RF_STATE_DETAIL_RX_STATE | SL_RAIL_STATE_DETAIL_TRANSITION If leaving TX: SL_RAIL_RF_STATE_TX Else: SL_RAIL_RF_STATE_RX SL_RAIL_RF_STATE_DETAIL_RX_STATE | SL_RAIL_RF_STATE_DETAIL_TRANSITION | SL_RAIL_RF_STATE_DETAIL_NO_FRAMES If leaving TX: SL_RAIL_RF_STATE_TX Else: SL_RAIL_RF_STATE_RX SL_RAIL_RF_STATE_DETAIL_RX_STATE SL_RAIL_RF_STATE_RX SL_RAIL_RF_STATE_DETAIL_RX_STATE | SL_RAIL_RF_STATE_DETAIL_NO_FRAMES SL_RAIL_RF_STATE_RX SL_RAIL_RF_STATE_DETAIL_RX_STATE | SL_RAIL_RF_STATE_DETAIL_LBT SL_RAIL_RF_STATE_RX SL_RAIL_RF_STATE_DETAIL_RX_STATE | SL_RAIL_RF_STATE_DETAIL_NO_FRAMES | SL_RAIL_RF_STATE_DETAIL_LBT SL_RAIL_RF_STATE_RX SL_RAIL_RF_STATE_DETAIL_RX_STATE | SL_RAIL_RF_STATE_DETAIL_ACTIVE SL_RAIL_RF_STATE_RX_ACTIVE SL_RAIL_RF_STATE_DETAIL_TX_STATE | SL_RAIL_RF_STATE_TRANSITION If leaving RX: SL_RAIL_RF_STATE_RX Else: SL_RAIL_RF_STATE_TX SL_RAIL_RF_STATE_DETAIL_TX_STATE | SL_RAIL_RF_STATE_ACTIVE SL_RAIL_RF_STATE_TX_ACTIVE
sl_rail_enable_cache_synth_cal#
sl_rail_status_t sl_rail_enable_cache_synth_cal (sl_rail_handle_t rail_handle, bool enable)
Enable/disable caching of synth calibration value.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A real RAIL instance handle. |
| bool | [in] | enable | A boolean to enable or disable caching of synth calibration. |
Returns
Status code indicating success of the function call.
Once enabled, the sequencer will start caching synth calibration values for channels and apply them instead of performing calibration on every state transition and channel change. This will increase the transition time for the first time calibration is performed. Subsequent state transitions will be faster. The cache size is 2. SL_RAIL_IEEE802154_SUPPORTS_RX_CHANNEL_SWITCHING internally uses this feature and there is no need to enable/disable it. This function returns SL_RAIL_STATUS_INVALID_STATE if we try to disable it while SL_RAIL_IEEE802154_SUPPORTS_RX_CHANNEL_SWITCHING is enabled.
Note
This function will improve the minimum timings that can be achieved in sl_rail_state_timing_t::idle_to_rx, sl_rail_state_timing_t::idle_to_tx, sl_rail_state_timing_t::rx_to_tx, sl_rail_state_timing_t::tx_to_rx and sl_rail_state_timing_t::tx_to_tx. A call to sl_rail_set_state_timing() is needed to achieve lower transition times.
On a protocol switch the cache is cleared, so it is not suitable for applications where a protocol switch happens frequently, like with Dynamic Multiprotocol.