BJT Temperature Sensor#
Introduction#
By taking use of its temperature-dependent characteristics, a Bipolar Junction Transistor (BJT) can be utilized as a temperature sensor.
BJT temperature sensor peripheral will be used to transform a digital output into a temperature in degrees Celsius.
BJT Temperature Sensor first reads the Band-gap and then reads the BJT value after the successful calibration it just computes the temperature value by taking the difference between BJT output and Band-gap output value.
By switching the current temperature mode, one can also obtain the temperature value in kelvin and fahrenheit.
Configuration#
By altering the macros in the mode below, one can change the temperature from Celsius to Kelvin and from Celsius to Fahrenheit.
By using the structured macros below, you can enable and disable the Bjt temperature sensor.
Usage#
The Bjt temperature sensor will first call the callback event after initializing and configuring the channel settings and operating mode. It will enable, configure, and read the BJT temperature value in the read data along with configuring and reading the band gap value. Once the values are successfully read, the temperature in Celsius will be computed.
In addition to the above mentioned apis, users can additionally modify the temperature mode and deinitialize the callback event by using the conversion and deinit apis.
Enumerations#
Functions#
Initialize the BJT temperature sensor.
Read data from the BJT temperature sensor.
Enable or disable the BJT temperature sensor.
Configure the BJT temperature sensor.
Configure band gap for BJT temperature sensor.
Convert the sensor reading to temperature in Celsius/Fahrenheit/Kelvin.
De-initialize the BJT temperature sensor.
Enumeration Documentation#
sl_bjt_temperature_sensor_enum_t#
sl_bjt_temperature_sensor_enum_t
Enumerator | |
---|---|
SL_BJT_DEGREE_CELSIUS | Temperature in degree celsius. |
SL_BJT_FAHRENHEIT | Temperature in fahrenheit. |
SL_BJT_KELVIN | Temperature in kelvin. |
55
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_bjt_temperature_sensor.h
sl_bjt_temperature_sensor_state_t#
sl_bjt_temperature_sensor_state_t
Enumerator | |
---|---|
SL_BJT_TEMPERATURE_SENSOR_DISABLE | Temperature sensing disable. |
SL_BJT_TEMPERATURE_SENSOR_ENABLE | Temperature sensing enable. |
SL_BJT_TEMPERATURE_SENSOR_LAST | Last member of enum for validation. |
62
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_bjt_temperature_sensor.h
Function Documentation#
sl_si91x_bjt_temperature_sensor_init#
sl_status_t sl_si91x_bjt_temperature_sensor_init (adc_ch_config_t sl_bjt_temperature_sensor_channel_config, adc_config_t sl_bjt_temperature_sensor_config)
Initialize the BJT temperature sensor.
[in] | sl_bjt_temperature_sensor_channel_config | BJT channels configuration structure channel number, sampling rate and sample length. |
[in] | sl_bjt_temperature_sensor_config | BJT configuration sets the operation mode and number of channels. |
Performs ADC initialization and configuration, sets the register callback and starts the ADC.
Returns
Status 0 if successful, else error code:
SL_STATUS_OK (0x0000) - Success
SL_STATUS_FAIL (0x0001) - Fail
SL_STATUS_INVALID_PARAMETER(0x0021) - invalid parameter
SL_STATUS_INVALID_RANGE(0x0028) - invalid range
SL_STATUS_INVALID_COUNT(0x002B) - invalid count
84
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_bjt_temperature_sensor.h
sl_si91x_bjt_temperature_sensor_read_data#
sl_status_t sl_si91x_bjt_temperature_sensor_read_data (double * temp_data)
Read data from the BJT temperature sensor.
[out] | temp_data | Temperature measurement data to convert |
Pre-condition:
Returns
Status 0 if successful, else error code:
SL_STATUS_OK (0x0000) - Success
SL_STATUS_FAIL (0x0001) - Fail
SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer
SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid
SL_STATUS_INVALID_RANGE (0x0028) - Mismatch Range
99
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_bjt_temperature_sensor.h
sl_si91x_bjt_temperature_sensor_state#
sl_status_t sl_si91x_bjt_temperature_sensor_state (sl_bjt_temperature_sensor_state_t state)
Enable or disable the BJT temperature sensor.
[in] | state | Value indicating whether to enable or disable the BJT temperature sensor:
|
Pre-conditions:
Returns
Status 0 if successful, else error code:
SL_STATUS_OK on success
SL_STATUS_INVALID_PARAMETER (0x0021) , The parameter is an invalid argument
113
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_bjt_temperature_sensor.h
sl_si91x_bjt_temperature_sensor_set_channel_configuration#
sl_status_t sl_si91x_bjt_temperature_sensor_set_channel_configuration (adc_ch_config_t sl_bjt_temperature_sensor_channel_config)
Configure the BJT temperature sensor.
[in] | sl_bjt_temperature_sensor_channel_config | BJT channel configuring positive input to BJT value |
Pre-condition:
Returns
Status 0 if successful, else error code:
SL_STATUS_OK on success
SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer
SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid
SL_STATUS_INVALID_RANGE (0x0028) - Mismatch Range
126
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_bjt_temperature_sensor.h
sl_si91x_bjt_temperature_sensor_bg_set_channel_configuration#
sl_status_t sl_si91x_bjt_temperature_sensor_bg_set_channel_configuration (adc_ch_config_t sl_bjt_temperature_sensor_channel_config)
Configure band gap for BJT temperature sensor.
[in] | sl_bjt_temperature_sensor_channel_config | Band gap channel configuring positive input to OPAMP value |
Pre-condition:
Returns
Status 0 if successful, else error code:
SL_STATUS_OK (0x0000) - Success
SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer
SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid
SL_STATUS_INVALID_RANGE (0x0028) - Mismatch Range
140
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_bjt_temperature_sensor.h
sl_si91x_get_bjt_temperature_sensor_conversion#
sl_status_t sl_si91x_get_bjt_temperature_sensor_conversion (double * temp_data, sl_bjt_temperature_sensor_enum_t current_temperature_mode)
Convert the sensor reading to temperature in Celsius/Fahrenheit/Kelvin.
[out] | temp_data | Temperature measurement data to convert |
[in] | current_temperature_mode | Current temperature mode |
Returns
Status 0 if successful, else error code:
SL_STATUS_OK (0x0000) - Success
SL_STATUS_FAIL (0x0001) - Fail
SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer
SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid
156
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_bjt_temperature_sensor.h
sl_si91x_bjt_temperature_sensor_deinit#
sl_status_t sl_si91x_bjt_temperature_sensor_deinit (adc_config_t sl_bjt_temperature_sensor_config)
De-initialize the BJT temperature sensor.
[in] | sl_bjt_temperature_sensor_config | De-initializing the BJT configuration |
Pre-condition:
Returns
Status 0 if successful, else error code:
SL_STATUS_OK (0x0000) - Success
SL_STATUS_FAIL (0x0001) - Fail
168
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_bjt_temperature_sensor.h