External Thermistor

APIs to measure temperature using an external thermistor.

Data Structures

struct RAIL_HFXOThermistorConfig_t
Configure the port and pin of the thermistor.

Macros

#define RAIL_INVALID_THERMISTOR_VALUE (0xFFFFFFFF)
A sentinel value to indicate an invalid thermistor measurement value.

Functions

RAIL_Status_t RAIL_StartThermistorMeasurement ( RAIL_Handle_t railHandle)
Start a Thermistor measurement.
RAIL_Status_t RAIL_GetThermistorImpedance ( RAIL_Handle_t railHandle, uint32_t *thermistorImpedance)
Get the thermistor impedance measurement and returns RAIL_INVALID_THERMISTOR_VALUE if the thermistor is not properly configured or the thermistor measurement is not ready.
RAIL_Status_t RAIL_ConvertThermistorImpedance ( RAIL_Handle_t railHandle, uint32_t thermistorImpedance, int16_t *thermistorTemperatureC)
Convert the thermistor impedance into temperature, in Celsius.
RAIL_Status_t RAIL_ComputeHFXOPPMError ( RAIL_Handle_t railHandle, int16_t crystalTemperatureC, int8_t *crystalPPMError)
Compute the crystal PPM deviation from the thermistor temperature.
RAIL_Status_t RAIL_ConfigHFXOThermistor ( RAIL_Handle_t railHandle, const RAIL_HFXOThermistorConfig_t *hfxoThermistorConfig)
Configure the GPIO for thermistor usage.

Detailed Description

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.

Function Documentation

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.

RAIL_ConfigHFXOThermistor()

RAIL_Status_t RAIL_ConfigHFXOThermistor ( RAIL_Handle_t railHandle,
const RAIL_HFXOThermistorConfig_t * hfxoThermistorConfig
)

Configure the GPIO for thermistor usage.

Parameters
railHandle A RAIL instance handle.
[in] hfxoThermistorConfig The thermistor configuration pointing to the GPIO port and pin to access.
Returns
Status code indicating success of the function call.
Note
The port and pin that must be passed in RAIL_HFXOThermistorConfig_t are GPIO_THMSW_EN_PORT and GPIO_THMSW_EN_PIN respectively.

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.

This function is provided in the rail_util_thermistor plugin to get accurate values from our boards thermistors. 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.

RAIL_GetThermistorImpedance()

RAIL_Status_t RAIL_GetThermistorImpedance ( RAIL_Handle_t railHandle,
uint32_t * thermistorImpedance
)

Get the thermistor impedance measurement and returns 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.

RAIL_StartThermistorMeasurement()

RAIL_Status_t RAIL_StartThermistorMeasurement ( RAIL_Handle_t railHandle )

Start a Thermistor measurement.

To get the Thermistor impedance, call the function RAIL_GetThermistorImpedance . On the EFR32xG22, 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.
Parameters
[in] railHandle A RAIL instance handle.
Returns
Status code indicating success of the function call.