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#
Functions#
Start a thermistor measurement.
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.
Convert the thermistor impedance into temperature, in Celsius.
Compute the crystal PPM deviation from the thermistor temperature.
Configure the GPIO for thermistor usage.
Configure the temperature parameters for HFXO compensation.
Get the temperature parameters for HFXO compensation.
Compute a frequency offset and compensate HFXO accordingly.
Macros#
A sentinel value to indicate an invalid thermistor measurement value.
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.
[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.
6465
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.
[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.
6480
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.
[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.
6499
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.
[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.
6518
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.
[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
The port and pin that must be passed in RAIL_HFXOThermistorConfig_t are GPIO_THMSW_EN_PORT and GPIO_THMSW_EN_PIN respectively.
6533
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.
[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
This function must be called after RAIL_ConfigHFXOThermistor to succeed.
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.
6562
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.
[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.
6573
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.
[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
This function only works for platforms having RAIL_SUPPORTS_EXTERNAL_THERMISTOR alongside RAIL_SUPPORTS_HFXO_COMPENSATION.
6587
of file common/rail.h
Macro Definition Documentation#
RAIL_INVALID_THERMISTOR_VALUE#
#define RAIL_INVALID_THERMISTOR_VALUEValue:
(0xFFFFFFFFU)
A sentinel value to indicate an invalid thermistor measurement value.
4572
of file common/rail_types.h
RAIL_INVALID_PPM_VALUE#
#define RAIL_INVALID_PPM_VALUEValue:
(-128)
A sentinel value to indicate an invalid PPM calculation value.
4574
of file common/rail_types.h