2.6.2.1 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 2-3. Members
TypeNameDescription
enum adc_accumulate_samplesaccumulate_samples

Number of ADC samples to accumulate when using the ADC_RESOLUTION_CUSTOM mode

enum adc_clock_prescalerclock_prescaler

Clock prescaler

enum gclk_generatorclock_source

GCLK generator used to clock the peripheral

struct adc_correction_configcorrection

Gain and offset correction configuration structure

booldifferential_mode

Enables differential mode if true

enum adc_divide_resultdivide_result

Division ration when using the ADC_RESOLUTION_CUSTOM mode

enum adc_event_actionevent_action

Event action to take on incoming event

boolfreerunning

Enables free running mode if true

boolleft_adjust

Left adjusted result

enum adc_negative_inputnegative_input

Negative MUX input

boolon_demand

ADC On demand control

enum adc_positive_inputpositive_input

Positive MUX input

uint32_tpositive_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_referencereference

Voltage reference

boolreference_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_resolutionresolution

Result resolution

boolrun_in_standby

ADC run in standby control

uint8_tsample_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).

boolsampling_time_compensation_enable

Enables sampling period offset compensation if true

struct adc_window_configwindow

Window monitor configuration structure