Functions for temperature measurements and sensor calibration. The granularity of all temperature values is given in the level of Celsius degrees.
More...
Functions for temperature measurements and sensor calibration. The granularity of all temperature values is given in the level of Celsius degrees.
◆ hw_gpadc_convert_celsius_x100_to_raw_val_util()
| uint16_t hw_gpadc_convert_celsius_x100_to_raw_val_util |
( |
const hw_gpadc_config_t * |
cfg, |
|
|
int16_t |
temperature |
|
) |
| |
Convert a temperature value to raw GPADC value.
- Parameters
-
| [in] | cfg | GPADC configuration, NULL to use the current ADC settings |
| [in] | temperature | temperature in hundredths of Celsius degrees (ex. 2540 = 25.4 C) |
- Returns
- 16-bit left-aligned ADC value (raw)
◆ hw_gpadc_convert_to_celsius_x100_util()
| int16_t hw_gpadc_convert_to_celsius_x100_util |
( |
const hw_gpadc_config_t * |
cfg, |
|
|
uint16_t |
raw_val |
|
) |
| |
Convert a 16-bit, left-aligned, raw value to temperature. For accurate conversions using this function the ADC should operate in the following configuration:
Positive and negative offset registers = Default (0x200 uncalibrated), SampleTime = 0x02, Oversampling = 64 Samples, Chopping = Enabled and Attenuator = Disabled.
- Parameters
-
| [in] | cfg | GPADC configuration, NULL to use the current ADC settings |
| [in] | raw_val | digital GPADC value |
- Returns
- temperature in hundredths of Celsius degrees (ex. 2540 = 25.4 C)
- See also
- hw_gpadc_config_t
-
hw_gpadc_set_offset_positive
-
hw_gpadc_set_offset_negative
◆ hw_gpadc_store_ambient_calibration_point()
| void hw_gpadc_store_ambient_calibration_point |
( |
uint16_t |
raw_val, |
|
|
int16_t |
temp |
|
) |
| |
Store temperature calibration point at ambient temperature.
- Parameters
-
| [in] | raw_val | ADC calibration value in 16-bit resolution |
| [in] | temp | temperature in (Celsius degrees x 100) |