Struct adc_config

Configuration structure for an ADC instance. This structure should be initialized by the adc_get_config_defaults() function before being modified by the user application.

Table 1. Members
Type Name Description
enum adc_accumulate_samples accumulate_samples

Number of ADC samples to accumulate when using the ADC_RESOLUTION_CUSTOM mode

enum adc_clock_prescaler clock_prescaler

Clock prescaler

enum gclk_generator clock_source

GCLK generator used to clock the peripheral

struct adc_correction_config correction

Gain and offset correction configuration structure

bool differential_mode

Enables differential mode if true

enum adc_divide_result divide_result

Division ration when using the ADC_RESOLUTION_CUSTOM mode

enum adc_event_action event_action

Event action to take on incoming event

bool freerunning

Enables free running mode if true

bool left_adjust

Left adjusted result

enum adc_negative_input negative_input

Negative MUX input

bool on_demand

ADC On demand control

enum adc_positive_input positive_input

Positive MUX input

uint32_t positive_input_sequence_mask_enable

Positive input enabled mask for conversion sequence. The sequence start from the lowest input, and go to the next enabled input automatically when the conversion is done. If no bits are set the sequence is disabled.

enum adc_reference reference

Voltage reference

bool reference_compensation_enable

Enables reference buffer offset compensation if true. This will increase the accuracy of the gain stage, but decreases the input impedance; therefore the startup time of the reference must be increased.

enum adc_resolution resolution

Result resolution

bool run_in_standby

ADC run in standby control

uint8_t sample_length

This value (0-63) control the ADC sampling time in number of half ADC prescaled clock cycles (depends of ADC_PRESCALER value), thus controlling the ADC input impedance. Sampling time is set according to the formula: Sample time = (sample_length+1) * (ADCclk / 2).

bool sampling_time_compensation_enable

Enables sampling period offset compensation if true

struct adc_window_config window

Window monitor configuration structure