SmartSnippets DA1459x SDK
Data Structures | Functions

Functions for temperature measurements and sensor calibration. The granularity of all temperature values is given in the level of Celsius degrees. More...

Data Structures

struct  hw_gpadc_calibration_point_t
 Calibration Data - (Temperature, 16-bit ADC value) pair. More...
 

Functions

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: More...
 
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. More...
 
void hw_gpadc_store_ambient_calibration_point (uint16_t raw_val, int16_t temp)
 Store temperature calibration point at ambient temperature. More...
 

Detailed Description

Functions for temperature measurements and sensor calibration. The granularity of all temperature values is given in the level of Celsius degrees.

Function Documentation

◆ 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]cfgGPADC configuration, NULL to use the current ADC settings
[in]temperaturetemperature 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]cfgGPADC configuration, NULL to use the current ADC settings
[in]raw_valdigital 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_valADC calibration value in 16-bit resolution
[in]temptemperature in (Celsius degrees x 100)