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 RAIL instance handle.

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

  • This function is not designed for safe usage in multiprotocol applications.

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

Returns

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


Definition at line 6582 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 RAIL instance handle.

[out]thermistorImpedance

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 6597 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 RAIL instance handle.

[in]thermistorImpedance

Current thermistor impedance measurement in Ohms.

[out]thermistorTemperatureC

Pointer to current thermistor temperature in eighth of Celsius degree

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.

The variable railHandle is only used to indicate to the user from where the function was called, so it is okay to use either a real protocol handle, or one of the chip-specific ones, such as RAIL_EFR32_HANDLE.

Note

  • This plugin is mandatory on EFR32xG25 platform.


Definition at line 6620 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 RAIL instance handle.

[in]crystalTemperatureC

Current crystal temperature.

[out]crystalPPMError

Pointer to current ppm error.

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. The variable railHandle is only used to indicate to the user from where the function was called, so it is okay to use either a real protocol handle, or one of the chip-specific ones, such as RAIL_EFR32_HANDLE.

Note

  • This plugin is mandatory on EFR32xG25 platform.


Definition at line 6641 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
N/ArailHandle

A RAIL instance handle.

[in]pHfxoThermistorConfig

The thermistor configuration pointing to the GPIO port and pin to access.

Returns

  • Status code indicating the result of the function call.

Note


Definition at line 6656 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
N/ArailHandle

A RAIL instance handle.

[in]pHfxoCompensationConfig

HFXO compensation parameters pointing to 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 6683 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
N/ArailHandle

A RAIL instance handle.

N/ApHfxoCompensationConfig

HFXO compensation parameters pointing to the temperature variations used to trigger a compensation.

Returns

  • Status code indicating the result of the function call.


Definition at line 6694 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
N/ArailHandle

A RAIL instance handle.

N/AcrystalPPMError

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 6708 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 4424 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 4426 of file common/rail_types.h