ADC Temperature Sensor configuration file.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
float | calculate_temperature (uint16_t raw_code) |
Temperature Calculation. More... | |
void | configure_adc_temp (void) |
ADC Temperature Sensor mode configuration. More... | |
float | convert_dec_to_frac (uint8_t val) |
Decimal to Fraction Conversation. More... | |
void | load_calibration_data (void) |
Calibration Data. More... | |
Variables | |
struct adc_module | adc_instance |
Support and FAQ: visit Microchip Support More... | |
uint16_t | ADCH |
uint16_t | ADCR |
float | coarse_temp |
float | fine_temp |
float | INT1VH |
float | INT1VR |
float | tempH |
float | tempR |
float | VADCH |
float | VADCR |
float calculate_temperature | ( | uint16_t | raw_code | ) |
Temperature Calculation.
This function calculate fine temperature using Equation1 and Equation 1b as mentioned in data sheet section "Temperature Sensor Characteristics" of Electrical Characteristics.
References ADC_12BIT_FULL_SCALE_VALUE_FLOAT, coarse_temp, fine_temp, INT1V_VALUE_FLOAT, INT1VH, INT1VR, tempH, tempR, VADCH, and VADCR.
Referenced by adc_temp_sensor().
void configure_adc_temp | ( | void | ) |
ADC Temperature Sensor mode configuration.
This function enables internal temperature sensor feature of ADC with below Settings
GLCK for ADC -> GCLK_GENERATOR_1 (8MHz) CLK_ADC -> 512 KHz REFERENCE -> internal 1 V POSITIVE INPUT -> INTRENAL Temperature reference NEGATIVE INPUT -> SAMPLES -> 4 SAMPLE_LENGTH -> 4
References adc_enable(), adc_get_config_defaults(), adc_init(), adc_instance, ADC_TEMP_SAMPLE_LENGTH, and GCLK_GENERATOR_1.
Referenced by adc_temp_sensor().
float convert_dec_to_frac | ( | uint8_t | val | ) |
Decimal to Fraction Conversation.
This function converts the decimal value into fractional and return the fractional value for temperature calculation
Referenced by load_calibration_data().
void load_calibration_data | ( | void | ) |
Calibration Data.
This function extract the production calibration data information from Temperature log row content and store it variables for temperature calculation
References ADC_12BIT_FULL_SCALE_VALUE_FLOAT, ADCH, ADCR, convert_dec_to_frac(), INT1V_DIVIDER_1000, INT1VH, INT1VR, tempH, tempR, VADCH, and VADCR.
Referenced by adc_temp_sensor().
struct adc_module adc_instance |
Support and FAQ: visit Microchip Support
Support and FAQ: visit Microchip Support
Support and FAQ: visit Microchip Support
[adc_module_inst]
Support and FAQ: visit Microchip Support
Support and FAQ: visit Microchip Support
[adc_module_inst]
Support and FAQ: visit Microchip Support
[module_inst]
Support and FAQ: visit Microchip Support
Support and FAQ: visit Microchip Support
[adc_module_inst]
Support and FAQ: visit Microchip Support
[module_inst]
Referenced by _lightsensor_init(), adc_correction_start(), adc_correction_stop(), adc_differential(), adc_hardware_averaging(), adc_oversampling(), adc_start_read_result(), adc_window_monitor(), adp_example_adc_get_value(), adp_example_adc_init(), configure_adc(), configure_adc_averaging(), configure_adc_callbacks(), configure_adc_differential(), configure_adc_sampling(), configure_adc_temp(), configure_adc_window_monitor(), configure_light_sensor(), io1_board_get_lightvalue(), io1_board_prepare_to_get_info(), main(), sam0_sensors_init(), and setup_transfer_descriptor().
uint16_t ADCH |
Referenced by load_calibration_data().
uint16_t ADCR |
Referenced by load_calibration_data().
float coarse_temp |
Referenced by calculate_temperature().
float fine_temp |
Referenced by calculate_temperature().
float INT1VH |
Referenced by calculate_temperature(), and load_calibration_data().
float INT1VR |
Referenced by calculate_temperature(), and load_calibration_data().
float tempH |
Referenced by calculate_temperature(), and load_calibration_data().
float tempR |
Referenced by calculate_temperature(), and load_calibration_data().
float VADCH |
Referenced by calculate_temperature(), and load_calibration_data().
float VADCR |
Referenced by calculate_temperature(), and load_calibration_data().