AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/adc/xmega_aau/adc_aau.c
void adcch_read_configuration(ADC_t * adc,
    uint8_t ch_mask,
    struct adc_channel_config *ch_conf)
{
    ADC_CH_t *adc_ch;
    irqflags_t flags;

    adc_ch = adc_get_channel(adc, ch_mask);

    flags = cpu_irq_save();

    adc_enable_clock(adc);
    ch_conf->ctrl = adc_ch->CTRL;
    ch_conf->intctrl = adc_ch->INTCTRL;
    ch_conf->muxctrl = adc_ch->MUXCTRL;
    if (ch_mask & ADC_CH0) {
        /* USB devices has channel scan available on ADC channel 0 */
        ch_conf->scan = adc_ch->SCAN;
    }
    adc_disable_clock(adc);

    cpu_irq_restore(flags);
}
/**
 * \brief Read configuration from ADC channel
 *
 * Reads out the current configuration from the ADC channel to the specified
 * buffer.
 *
 * \param adc Pointer to ADC module.
 * \param ch_mask Mask of ADC channel(s):
 * \arg \c ADC_CHn , where \c n specifies the channel. (Only a single channel
 * can be given in mask)
 * \param ch_conf Pointer to ADC channel configuration.
 */
\brief Read configuration from ADC channel
Reads out the current configuration from the ADC channel to the specified
buffer.

\param adc Pointer to ADC module.
\param ch_mask Mask of ADC channel(s):
\arg \c ADC_CHn , where \c n specifies the channel. (Only a single channel
can be given in mask)
\param ch_conf Pointer to ADC channel configuration.
\ brief Read configuration from ADC channel Reads out the current configuration from the ADC channel to the specified buffer . \ param adc Pointer to ADC module . \ param ch_mask Mask of ADC channel ( s ) : \ arg \ c ADC_CHn where \ c n specifies the channel . ( Only a single channel can be given in mask ) \ param ch_conf Pointer to ADC channel configuration .
void adcch_read_configuration(ADC_t * adc,
    uint8_t ch_mask,
    struct adc_channel_config *ch_conf)
{
    ADC_CH_t *adc_ch;
    irqflags_t flags;
    adc_ch = adc_get_channel(adc, ch_mask);
    flags = cpu_irq_save();
    adc_enable_clock(adc);
    ch_conf->ctrl = adc_ch->CTRL;
    ch_conf->intctrl = adc_ch->INTCTRL;
    ch_conf->muxctrl = adc_ch->MUXCTRL;
    if (ch_mask & ADC_CH0) {
        ch_conf->scan = adc_ch->SCAN;
    }
    adc_disable_clock(adc);
    cpu_irq_restore(flags);
}
void adcch_read_configuration ( ADC_t * adc , uint8_t ch_mask , struct adc_channel_config * ch_conf ) { ADC_CH_t * adc_ch ; irqflags_t flags ; adc_ch = adc_get_channel ( adc , ch_mask ) ; flags = cpu_irq_save ( ) ; adc_enable_clock ( adc ) ; ch_conf -> ctrl = adc_ch -> CTRL ; ch_conf -> intctrl = adc_ch -> INTCTRL ; ch_conf -> muxctrl = adc_ch -> MUXCTRL ; if ( ch_mask & ADC_CH0 ) { ch_conf -> scan = adc_ch -> SCAN ; } adc_disable_clock ( adc ) ; cpu_irq_restore ( flags ) ; }
\brief Read configuration from ADC channel
 Reads out the current configuration from the ADC channel to the specified
 buffer.
\ brief Read configuration from ADC channel Reads out the current configuration from the ADC channel to the specified buffer .
/* USB devices has channel scan available on ADC channel 0 */