Diagnostic

APIs for diagnostic and test chip modes.

Modules

EFR32
Types specific to the EFR32 for the diagnostic routines.

Data Structures

struct RAIL_VerifyConfig_t
The configuration array provided to RAIL for use by the radio state verification feature.

Macros

#define RAIL_VERIFY_DURATION_MAX 0xFFFFFFFFUL
This radio state verification duration indicates to RAIL that all memory contents should be verified by RAIL before returning to the application.

Typedefs

typedef bool(* RAIL_VerifyCallbackPtr_t ) (uint32_t address, uint32_t expectedValue, uint32_t actualValue)
A pointer to a verification callback function.

Enumerations

enum RAIL_StreamMode_t {
RAIL_STREAM_CARRIER_WAVE = 0,
RAIL_STREAM_PN9_STREAM = 1
}
Possible stream output modes.

Functions

RAIL_Status_t RAIL_EnableDirectMode ( RAIL_Handle_t railHandle, bool enable)
Enables or disables direct mode for RAIL.
RAIL_Status_t RAIL_SetTune ( RAIL_Handle_t railHandle, uint32_t tune)
Sets the crystal tuning.
uint32_t RAIL_GetTune ( RAIL_Handle_t railHandle)
Gets the crystal tuning.
RAIL_FrequencyOffset_t RAIL_GetRxFreqOffset ( RAIL_Handle_t railHandle)
Gets the frequency offset.
RAIL_Status_t RAIL_SetFreqOffset ( RAIL_Handle_t railHandle, RAIL_FrequencyOffset_t freqOffset)
Sets the nominal radio frequency offset.
RAIL_Status_t RAIL_StartTxStream ( RAIL_Handle_t railHandle, uint16_t channel, RAIL_StreamMode_t mode)
Starts transmitting a stream on a certain channel.
RAIL_Status_t RAIL_StopTxStream ( RAIL_Handle_t railHandle)
Stops stream transmission.
RAIL_Status_t RAIL_ConfigVerification ( RAIL_Handle_t railHandle, RAIL_VerifyConfig_t *configVerify, const uint32_t *radioConfig, RAIL_VerifyCallbackPtr_t cb)
Configures the verification of radio memory contents.
RAIL_Status_t RAIL_Verify ( RAIL_VerifyConfig_t *configVerify, uint32_t durationUs, bool restart)
Verifies radio memory contents.

Detailed Description

APIs for diagnostic and test chip modes.

Typedef Documentation

typedef bool(* RAIL_VerifyCallbackPtr_t) (uint32_t address, uint32_t expectedValue, uint32_t actualValue)

A pointer to a verification callback function.

This will be called by the radio state verification feature built into RAIL when a verified memory value is different from its reference value.

Parameters
[in] address The address of the data in question.
[in] expectedValue The expected value of the data in question.
[in] actualValue The actual value of the data in question.
Returns
bool True indicates a data value difference is acceptable. False indicates a data value difference in unacceptable.
Note
This callback will be issued when an address' value is different from its reference value and either of the following conditions are met: 1) The default radio configuration provided by the radio configurator is used for verification purposes (i.e., a custom radio configuration is not supplied as an input to RAIL_ConfigVerification() ), and the radio configurator has flagged the address under question as being verifiable. 2) A custom radio configuration is provided to the verification API (i.e., a custom radio configuration is supplied as an input to RAIL_ConfigVerification() ). When providing a custom radio configuration for verification purposes, all addresses in that configuration will be verified, regardless of whether or not the addresses are flagged as verifiable.

Definition at line 2195 of file rail_types.h .

Enumeration Type Documentation

Possible stream output modes.

Enumerator
RAIL_STREAM_CARRIER_WAVE

An unmodulated carrier wave.

RAIL_STREAM_PN9_STREAM

PN9 byte sequence.

Definition at line 2159 of file rail_types.h .

Function Documentation

RAIL_Status_t RAIL_ConfigVerification ( RAIL_Handle_t railHandle,
RAIL_VerifyConfig_t * configVerify,
const uint32_t * radioConfig,
RAIL_VerifyCallbackPtr_t cb
)

Configures the verification of radio memory contents.

Parameters
[in] railHandle A RAIL instance handle.
[in,out] configVerify A configuration structure made available to RAIL to perform radio state verification. This structure must be allocated in application global read-write memory. RAIL may modify fields within or referenced by this structure during its operation.
[in] radioConfig A pointer to a radioConfig that is to be used as a white list for verifying memory contents.
[in] cb A callback that notifies the application of a mismatch in expected vs actual memory contents. A NULL parameter may be passed in if a callback is not provided by the application.
Returns
RAIL_STATUS_NO_ERROR if setup of the verification feature successfully occurred. RAIL_STATUS_INVALID_PARAMETER is returned if the provided railHandle or configVerify structures are invalid.

Referenced by RAIL_CopyRxPacket() .

RAIL_Status_t RAIL_EnableDirectMode ( RAIL_Handle_t railHandle,
bool enable
)

Enables or disables direct mode for RAIL.

Parameters
[in] railHandle A RAIL instance handle.
[in] enable Whether or not to enable direct mode.
Returns
RAIL_STATUS_NO_ERROR on success and an error code on failure.
Warning
This API configures fixed pins for TX data in, RX data out, and RX clock out. There should be more control over these pins in the future but they are currently fixed. Also, this API is not safe to use in a true multiprotocol app.

In this mode, packets are output and input directly to the radio via GPIO and RAIL packet handling is ignored. On the EFR32, the DIN pin in TX is EFR32_PC10, which corresponds to EXP_HEADER15/WSTKP12, and the DOUT pin in RX is EFR32_PC11, which corresponds to EXP_HEADER16/WSTKP13.

Referenced by RAIL_CopyRxPacket() .

RAIL_FrequencyOffset_t RAIL_GetRxFreqOffset ( RAIL_Handle_t railHandle )

Gets the frequency offset.

Parameters
[in] railHandle A RAIL instance handle.
Returns
Returns the measured frequency offset on a received packet. The units are described in the RAIL_FrequencyOffset_t documentation. If this returns RAIL_FREQUENCY_OFFSET_INVALID , it was called while the radio wasn't active and there is no way to get the frequency offset.

Retrieves the measured frequency offset used during the previous received packet, which includes the current radio frequency offset (see RAIL_SetFreqOffset() ). If the chip has not been in RX, it returns the nominal radio frequency offset.

Referenced by RAIL_CopyRxPacket() .

uint32_t RAIL_GetTune ( RAIL_Handle_t railHandle )

Gets the crystal tuning.

Parameters
[in] railHandle A RAIL instance handle.
Returns
A chip-dependent crystal capacitor bank tuning parameter.

Retrieves the current tuning value used by the crystal that the radio depends on.

Referenced by RAIL_CopyRxPacket() .

RAIL_Status_t RAIL_SetFreqOffset ( RAIL_Handle_t railHandle,
RAIL_FrequencyOffset_t freqOffset
)

Sets the nominal radio frequency offset.

Parameters
[in] railHandle A RAIL instance handle.
[in] freqOffset RAIL_FrequencyOffset_t parameter (signed, 2's complement).
Returns
Status code indicating success of the function call.

This function is used to adjust the radio's tuning frequency slightly up or down. It might be used in conjunction with RAIL_GetRxFreqOffset() after receiving a packet from a peer to adjust the tuner to better match the peer's tuned frequency.

Note
Unlike RAIL_SetTune() , which affects the entire chip's timing including radio tuning and channel spacing, this function only affects radio tuning without disturbing channel spacing or other chip peripheral timing.

Referenced by RAIL_CopyRxPacket() .

RAIL_Status_t RAIL_SetTune ( RAIL_Handle_t railHandle,
uint32_t tune
)

Sets the crystal tuning.

Parameters
[in] railHandle A RAIL instance handle.
[in] tune A chip-dependent crystal capacitor bank tuning parameter.
Returns
Status code indicating success of the function call.

Tunes the crystal that the radio depends on to change the location of the center frequency for transmitting and receiving. This function will only succeed if the radio is idle at the time of the call.

Note
This function proportionally affects the entire chip's timing across all its peripherals, including radio tuning and channel spacing. A separate function, RAIL_SetFreqOffset() , can be used to adjust just the radio tuner without disturbing channel spacing or other chip peripheral timing.

Referenced by RAIL_CopyRxPacket() .

RAIL_Status_t RAIL_StartTxStream ( RAIL_Handle_t railHandle,
uint16_t channel,
RAIL_StreamMode_t mode
)

Starts transmitting a stream on a certain channel.

Parameters
[in] railHandle A RAIL instance handle.
[in] channel A channel on which to emit a stream.
[in] mode Choose the stream mode (PN9, and so on).
Returns
Status code indicating success of the function call.

Begins streaming onto the given channel. The sources can either be an unmodulated carrier wave or an encoded stream of bits from a PN9 source. All ongoing radio operations will be stopped before transmission begins.

Referenced by RAIL_CopyRxPacket() .

RAIL_Status_t RAIL_StopTxStream ( RAIL_Handle_t railHandle )

Stops stream transmission.

Parameters
[in] railHandle A RAIL instance handle.
Returns
Status code indicating success of the function call.

Halts the transmission started by RAIL_StartTxStream() .

Referenced by RAIL_CopyRxPacket() .

RAIL_Status_t RAIL_Verify ( RAIL_VerifyConfig_t * configVerify,
uint32_t durationUs,
bool restart
)

Verifies radio memory contents.

Parameters
[in,out] configVerify A configuration structure made available to RAIL to perform radio state verification. This structure must be allocated in application global read-write memory. RAIL may modify fields within or referenced by this structure during its operation.
[in] durationUs The duration (in microseconds) for how long memory verification should occur before returning to the application. A value of RAIL_VERIFY_DURATION_MAX indicates that all memory contents should be verified before returning to the application.
[in] restart This flag only has meaning if a previous call of this function returned RAIL_STATUS_SUSPENDED . By restarting (true), the verification process starts over from the beginning, or by resuming where verification left off after being suspended (false), verification can proceed towards completion.
Returns
RAIL_STATUS_NO_ERROR if the contents of all applicable memory locations have been verified. RAIL_STATUS_SUSPENDED is returned if the provided test duration expired but the time was not sufficient to verify all memory contents. By calling RAIL_Verify again, further verification will commence. RAIL_STATUS_INVALID_PARAMETER is returned if the provided verifyConfig structure pointer is not configured for use by the active RAIL handle. RAIL_STATUS_INVALID_STATE is returned if any of the verified memory contents are different from their reference values.

Referenced by RAIL_CopyRxPacket() .