Atmel Software Framework

classb_analog.c File Reference

ADC and DAC test.

Application note:
AVR1610: Guide to IEC60730 Class B compliance with XMEGA

Copyright (C) 2011-2015 Atmel Corporation. All rights reserved.

#include "classb_analog.h"
#include "error_handler.h"

Functions

void classb_analog_io_test (DAC_t *dacptr, ADC_t *adcptr)
 Functional test for the ADC, DAC and analog MUX. More...
 
static void classb_dac_adc_test (DAC_t *dacptr, ADC_t *adcptr, uint16_t dac_out, uint16_t adc_assert)
 Internal function for analog test. More...
 

static void classb_dac_adc_test ( DAC_t *  dacptr,
ADC_t *  adcptr,
uint16_t  dac_out,
uint16_t  adc_assert 
)
static

Internal function for analog test.

This test writes a value to the DAC, and checks that the ADC readouts are within the expected range, which is set with CLASSB_ADC_DEV.

Parameters
dacptrBase address for registers of DAC module to test.
adcptrBase address for registers of ADC module to test.
dac_outOutput value to test the DAC with.
adc_assertExpected ADC value to measure.

References abs, CLASSB_ADC_DEV, and CLASSB_ERROR_HANDLER_ANALOG.

Referenced by classb_analog_io_test().