Microchip® Advanced Software Framework

temp_sensor.h File Reference

Temperature Sensor service.

Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.

Macros

#define ADC_12BIT_FULL_SCALE_VALUE_FLOAT   4095.0
 
#define ADC_TEMP_SAMPLE_LENGTH   63
 
#define INT1V_DIVIDER_1000   1000.0
 
#define INT1V_VALUE_FLOAT   1.0
 

Functions

void get_temp_sensor_data (uint8_t *data)
 Function to read the temperature sensor value. More...
 
void temp_sensor_init (void)
 Function to initialize the ADC for reading temperature sensor value. More...
 

#define ADC_12BIT_FULL_SCALE_VALUE_FLOAT   4095.0
#define ADC_TEMP_SAMPLE_LENGTH   63

Referenced by temp_sensor_init().

#define INT1V_DIVIDER_1000   1000.0

Referenced by load_calibration_data().

#define INT1V_VALUE_FLOAT   1.0

Referenced by calculate_temperature().

void get_temp_sensor_data ( uint8_t *  data)

Function to read the temperature sensor value.

Parameters
[out]Pointerto Temperature Sensor output value

References temp_sensor_value().

Referenced by get_resource_data().

void temp_sensor_init ( void  )

Function to initialize the ADC for reading temperature sensor value.

Function to initialize the ADC for reading temperature sensor value.

This function enables internal temperature sensor feature of ADC with below Settings

GLCK for ADC -> GCLK_GENERATOR_2 (16MHz) CLK_ADC -> 1.6 KHz REFERENCE -> internal 1 V POSITIVE INPUT -> INTRENAL Temperature reference NEGATIVE INPUT -> GND SAMPLES -> 4 SAMPLE_LENGTH -> 4

References ADC_CLOCK_PRESCALER_DIV2, adc_enable(), adc_get_config_defaults(), adc_init(), adc_instance, ADC_NEGATIVE_INPUT_GND, ADC_POSITIVE_INPUT_TEMP, ADC_TEMP_SAMPLE_LENGTH, adc_config::clock_prescaler, adc_config::clock_source, GCLK_GENERATOR_2, adc_config::negative_input, adc_config::positive_input, adc_config::reference, adc_config::sample_length, system_voltage_reference_disable(), system_voltage_reference_enable(), SYSTEM_VOLTAGE_REFERENCE_OUTPUT, and SYSTEM_VOLTAGE_REFERENCE_TEMPSENSE.

Referenced by resource_init().