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.

  1. sl_si91x_bjt_temperature_sensor_init

  2. sl_si91x_bjt_temperature_sensor_read_data

  3. sl_si91x_bjt_temperature_sensor_state

  4. sl_si91x_bjt_temperature_sensor_set_channel_configuration

  5. sl_si91x_bjt_temperature_sensor_bg_set_channel_configuration

  • 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.

  1. sl_si91x_bjt_temperature_sensor_deinit

  2. sl_si91x_get_bjt_temperature_sensor_conversion

Enumerations#

enum
SL_BJT_DEGREE_CELSIUS
SL_BJT_FAHRENHEIT
SL_BJT_KELVIN
}
enum
SL_BJT_TEMPERATURE_SENSOR_DISABLE
SL_BJT_TEMPERATURE_SENSOR_ENABLE
SL_BJT_TEMPERATURE_SENSOR_LAST
}

Functions#

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.

sl_status_t

Read data from the BJT temperature sensor.

sl_status_t
sl_si91x_bjt_temperature_sensor_state(sl_bjt_temperature_sensor_state_t state)

Enable or disable the BJT temperature sensor.

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.

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.

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.

sl_status_t
sl_si91x_bjt_temperature_sensor_deinit(adc_config_t sl_bjt_temperature_sensor_config)

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.


Definition at line 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.


Definition at line 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.

Parameters
[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


Definition at line 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.

Parameters
[out]temp_data

Temperature measurement data to convert

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


Definition at line 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.

Parameters
[in]state

Value indicating whether to enable or disable the BJT temperature sensor:

  • 1 - Enable

  • 0 - Disable

Returns

  • Status 0 if successful, else error code:

    • SL_STATUS_OK on success

    • SL_STATUS_INVALID_PARAMETER (0x0021) , The parameter is an invalid argument


Definition at line 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.

Parameters
[in]sl_bjt_temperature_sensor_channel_config

BJT channel configuring positive input to BJT value

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


Definition at line 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.

Parameters
[in]sl_bjt_temperature_sensor_channel_config

Band gap channel configuring positive input to OPAMP value

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


Definition at line 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.

Parameters
[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


Definition at line 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.

Parameters
[in]sl_bjt_temperature_sensor_config

De-initializing the BJT configuration

Returns

  • Status 0 if successful, else error code:

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_FAIL (0x0001) - Fail


Definition at line 168 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_bjt_temperature_sensor.h