Microchip® Advanced Software Framework

adc_correction_config Struct Reference

Gain and offset correction configuration structure.

Gain and offset correction configuration structure. Part of the adc_config struct and will be initialized by adc_get_config_defaults.

#include <adc_feature.h>

Data Fields

bool correction_enable
 Enables correction for gain and offset based on values of gain_correction and offset_correction if set to true. More...
 
uint16_t gain_correction
 This value defines how the ADC conversion result is compensated for gain error before written to the result register. More...
 
int16_t offset_correction
 This value defines how the ADC conversion result is compensated for offset error before written to the result register. More...
 

bool adc_correction_config::correction_enable

Enables correction for gain and offset based on values of gain_correction and offset_correction if set to true.

Referenced by _adc_set_config(), and adc_get_config_defaults().

uint16_t adc_correction_config::gain_correction

This value defines how the ADC conversion result is compensated for gain error before written to the result register.

This is a fractional value, 1-bit integer plus an 11-bit fraction, therefore 1/2 <= gain_correction < 2. Valid gain_correction values ranges from 0b010000000000 to 0b111111111111.

Referenced by _adc_set_config(), and adc_get_config_defaults().

int16_t adc_correction_config::offset_correction

This value defines how the ADC conversion result is compensated for offset error before written to the result register.

This is a 12-bit value in two's complement format.

Referenced by _adc_set_config(), and adc_get_config_defaults().