External Thermistor#

APIs to measure temperature using an external thermistor.

This feature allows reading the temperature via an external thermistor on chips that support it. This will require connecting the necessary components and configuring the pins as required.

Modules#

RAIL_HFXOThermistorConfig_t

RAIL_HFXOCompensationConfig_t

Functions#

RAIL_StartThermistorMeasurement(RAIL_Handle_t railHandle)

Start a thermistor measurement.

RAIL_GetThermistorImpedance(RAIL_Handle_t railHandle, uint32_t *thermistorImpedance)

Get the thermistor impedance measurement and return RAIL_INVALID_THERMISTOR_VALUE if the thermistor is not properly configured or the thermistor measurement is not ready.

RAIL_ConvertThermistorImpedance(RAIL_Handle_t railHandle, uint32_t thermistorImpedance, int16_t *thermistorTemperatureC)

Convert the thermistor impedance into temperature, in Celsius.

RAIL_ComputeHFXOPPMError(RAIL_Handle_t railHandle, int16_t crystalTemperatureC, int8_t *crystalPPMError)

Compute the crystal PPM deviation from the thermistor temperature.

RAIL_ConfigHFXOThermistor(RAIL_Handle_t railHandle, const RAIL_HFXOThermistorConfig_t *pHfxoThermistorConfig)

Configure the GPIO for thermistor usage.

RAIL_ConfigHFXOCompensation(RAIL_Handle_t railHandle, const RAIL_HFXOCompensationConfig_t *pHfxoCompensationConfig)

Configure the temperature parameters for HFXO compensation.

RAIL_GetHFXOCompensationConfig(RAIL_Handle_t railHandle, RAIL_HFXOCompensationConfig_t *pHfxoCompensationConfig)

Get the temperature parameters for HFXO compensation.

RAIL_CompensateHFXO(RAIL_Handle_t railHandle, int8_t crystalPPMError)

Compute a frequency offset and compensate HFXO accordingly.

Macros#

#define

A sentinel value to indicate an invalid thermistor measurement value.

#define

A sentinel value to indicate an invalid PPM calculation value.

Function Documentation#

RAIL_StartThermistorMeasurement#

RAIL_Status_t RAIL_StartThermistorMeasurement (RAIL_Handle_t railHandle)

Start a thermistor measurement.

Parameters
[in]railHandle

A radio-generic or real RAIL instance handle.

Returns

  • Status code indicating success of the function call. Returns RAIL_STATUS_INVALID_STATE if the thermistor is started while the radio is transmitting.

To get the thermistor impedance, call the function RAIL_GetThermistorImpedance. On platforms having RAIL_SUPPORTS_EXTERNAL_THERMISTOR, this function reconfigures GPIO_THMSW_EN_PIN located in GPIO_THMSW_EN_PORT. To locate this pin, refer to the data sheet or appropriate header files of the device. For proper operation, RAIL_Init must be called before using this function.

Note

  • When an EFF is attached, this function must not be called during transmit.

Warnings

  • This API is not safe to use in a multiprotocol app.


Definition at line 6439 of file common/rail.h

RAIL_GetThermistorImpedance#

RAIL_Status_t RAIL_GetThermistorImpedance (RAIL_Handle_t railHandle, uint32_t * thermistorImpedance)

Get the thermistor impedance measurement and return RAIL_INVALID_THERMISTOR_VALUE if the thermistor is not properly configured or the thermistor measurement is not ready.

Parameters
[in]railHandle

A radio-generic or real RAIL instance handle.

[out]thermistorImpedance

A pointer to a uint32_t updated with the current thermistor impedance measurement in Ohms.

Returns

  • Status code indicating success of the function call.

Note

  • This function is already called in RAIL_CalibrateHFXO(). It does not need to be manually called during the compensation sequence.


Definition at line 6454 of file common/rail.h

RAIL_ConvertThermistorImpedance#

RAIL_Status_t RAIL_ConvertThermistorImpedance (RAIL_Handle_t railHandle, uint32_t thermistorImpedance, int16_t * thermistorTemperatureC)

Convert the thermistor impedance into temperature, in Celsius.

Parameters
[in]railHandle

A radio-generic or real RAIL instance handle.

[in]thermistorImpedance

Current thermistor impedance measurement in Ohms.

[out]thermistorTemperatureC

A non-NULL pointer to an int16_t updated with the current thermistor temperature in eighth of Celsius degrees.

Returns

  • Status code indicating success of the function call.

A version of this function is provided in the Thermistor Utility plugin for Silicon Labs radio boards. For custom boards this function can be modified and re-implemented as needed.

Note

  • This plugin is mandatory on EFR32xG25 platform.


Definition at line 6473 of file common/rail.h

RAIL_ComputeHFXOPPMError#

RAIL_Status_t RAIL_ComputeHFXOPPMError (RAIL_Handle_t railHandle, int16_t crystalTemperatureC, int8_t * crystalPPMError)

Compute the crystal PPM deviation from the thermistor temperature.

Parameters
[in]railHandle

A radio-generic or real RAIL instance handle.

[in]crystalTemperatureC

Current crystal temperature, in Celsius.

[out]crystalPPMError

A non-NULL pointer to an int16_t updated with the current ppm error in ppm units.

Returns

  • Status code indicating success of the function call.

This function is provided in the rail_util_thermistor plugin to get accurate values from our boards thermistor. For a custom board, this function could be modified and re-implemented for other needs.

Note

  • This plugin is mandatory on EFR32xG25 platform.


Definition at line 6492 of file common/rail.h

RAIL_ConfigHFXOThermistor#

RAIL_Status_t RAIL_ConfigHFXOThermistor (RAIL_Handle_t railHandle, const RAIL_HFXOThermistorConfig_t * pHfxoThermistorConfig)

Configure the GPIO for thermistor usage.

Parameters
[in]railHandle

A radio-generic or real RAIL instance handle.

[in]pHfxoThermistorConfig

A pointer to the thermistor configuration indicating the GPIO port and pin to use.

Returns

  • Status code indicating the result of the function call.

Note


Definition at line 6507 of file common/rail.h

RAIL_ConfigHFXOCompensation#

RAIL_Status_t RAIL_ConfigHFXOCompensation (RAIL_Handle_t railHandle, const RAIL_HFXOCompensationConfig_t * pHfxoCompensationConfig)

Configure the temperature parameters for HFXO compensation.

Parameters
[in]railHandle

A RAIL instance handle.

[in]pHfxoCompensationConfig

A pointer to HFXO compensation parameters indicating the temperature variations used to trigger a compensation.

Returns

  • Status code indicating the result of the function call.

Note

In RAIL_HFXOCompensationConfig_t, deltaNominal and deltaCritical define the temperature variation triggering a new compensation. The field zoneTemperatureC defines the temperature separating the nominal case (below) from the critical one (above).

When enabled and either deltaNominal or deltaCritical are exceeded, RAIL raises event RAIL_EVENT_CAL_NEEDED with RAIL_CAL_TEMP_HFXO bit set. The API RAIL_StartThermistorMeasurement() must be called afterwards. The latter will raise RAIL_EVENT_THERMISTOR_DONE with calibration bit RAIL_CAL_COMPENSATE_HFXO set and RAIL_CalibrateHFXO() must follow.

Note

  • Set deltaNominal and deltaCritical to 0 to perform compensation after each transmit.


Definition at line 6536 of file common/rail.h

RAIL_GetHFXOCompensationConfig#

RAIL_Status_t RAIL_GetHFXOCompensationConfig (RAIL_Handle_t railHandle, RAIL_HFXOCompensationConfig_t * pHfxoCompensationConfig)

Get the temperature parameters for HFXO compensation.

Parameters
[in]railHandle

A RAIL instance handle.

[out]pHfxoCompensationConfig

A non-NULL pointer to HFXO compensation parameters filled in by the function.

Returns

  • Status code indicating the result of the function call.


Definition at line 6547 of file common/rail.h

RAIL_CompensateHFXO#

RAIL_Status_t RAIL_CompensateHFXO (RAIL_Handle_t railHandle, int8_t crystalPPMError)

Compute a frequency offset and compensate HFXO accordingly.

Parameters
[in]railHandle

A RAIL instance handle.

[in]crystalPPMError

The current ppm error. Positive values indicate the HFXO frequency is too high; negative values indicate it's too low.

Returns

  • Status code indicating success of the function call.

Note


Definition at line 6561 of file common/rail.h

Macro Definition Documentation#

RAIL_INVALID_THERMISTOR_VALUE#

#define RAIL_INVALID_THERMISTOR_VALUE
Value:
(0xFFFFFFFFU)

A sentinel value to indicate an invalid thermistor measurement value.


Definition at line 4519 of file common/rail_types.h

RAIL_INVALID_PPM_VALUE#

#define RAIL_INVALID_PPM_VALUE
Value:
(-128)

A sentinel value to indicate an invalid PPM calculation value.


Definition at line 4521 of file common/rail_types.h