AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/adc/xmega_aau/adc_aau.c
void adc_read_configuration(ADC_t * adc,
    struct adc_config *conf)
{
    irqflags_t flags = cpu_irq_save();

    adc_enable_clock(adc);

    conf->ctrla = adc->CTRLA & ADC_DMASEL_gm;

    conf->cmp = adc->CMP;
    conf->refctrl = adc->REFCTRL;
    conf->prescaler = adc->PRESCALER;
    conf->evctrl = adc->EVCTRL;
    conf->ctrlb = adc->CTRLB;

    adc_disable_clock(adc);

    cpu_irq_restore(flags);
}
/**
 * \brief Read configuration from ADC module
 *
 * Reads out the current configuration of the ADC module to the specified
 * buffer.
 *
 * \param adc Pointer to ADC module.
 * \param conf Pointer to ADC module configuration.
 */
\brief Read configuration from ADC module
Reads out the current configuration of the ADC module to the specified
buffer.

\param adc Pointer to ADC module.
\param conf Pointer to ADC module configuration.
\ brief Read configuration from ADC module Reads out the current configuration of the ADC module to the specified buffer . \ param adc Pointer to ADC module . \ param conf Pointer to ADC module configuration .
void adc_read_configuration(ADC_t * adc,
    struct adc_config *conf)
{
    irqflags_t flags = cpu_irq_save();
    adc_enable_clock(adc);
    conf->ctrla = adc->CTRLA & ADC_DMASEL_gm;
    conf->cmp = adc->CMP;
    conf->refctrl = adc->REFCTRL;
    conf->prescaler = adc->PRESCALER;
    conf->evctrl = adc->EVCTRL;
    conf->ctrlb = adc->CTRLB;
    adc_disable_clock(adc);
    cpu_irq_restore(flags);
}
void adc_read_configuration ( ADC_t * adc , struct adc_config * conf ) { irqflags_t flags = cpu_irq_save ( ) ; adc_enable_clock ( adc ) ; conf -> ctrla = adc -> CTRLA & ADC_DMASEL_gm ; conf -> cmp = adc -> CMP ; conf -> refctrl = adc -> REFCTRL ; conf -> prescaler = adc -> PRESCALER ; conf -> evctrl = adc -> EVCTRL ; conf -> ctrlb = adc -> CTRLB ; adc_disable_clock ( adc ) ; cpu_irq_restore ( flags ) ; }
\brief Read configuration from ADC module
 Reads out the current configuration of the ADC module to the specified
 buffer.
\ brief Read configuration from ADC module Reads out the current configuration of the ADC module to the specified buffer .