Atmel Software Framework

adc_aau.c File Reference

AVR XMEGA A/AU specific ADC driver implementation.

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

#include "../adc.h"

Functions

Internal functions for driver
void adc_enable_clock (ADC_t *adc)
 Enable peripheral clock for ADC. More...
 
void adc_disable_clock (ADC_t *adc)
 Disable peripheral clock for ADC. More...
 
ADC module configuration
void adc_write_configuration (ADC_t *adc, const struct adc_config *conf)
 Write configuration to ADC module. More...
 
void adc_read_configuration (ADC_t *adc, struct adc_config *conf)
 Read configuration from ADC module. More...
 
ADC channel configuration
void adcch_write_configuration (ADC_t *adc, uint8_t ch_mask, const struct adc_channel_config *ch_conf)
 Write configuration to ADC channel. More...
 
void adcch_read_configuration (ADC_t *adc, uint8_t ch_mask, struct adc_channel_config *ch_conf)
 Read configuration from ADC channel. More...
 

void adc_disable_clock ( ADC_t *  adc)

Disable peripheral clock for ADC.

Decrements the enable count for the ADC, then disables its peripheral clock if the count hit zero. If the count did not hit zero, it indicates the ADC is enabled.

Parameters
adcPointer to ADC module

References Assert, SYSCLK_ADC, sysclk_disable_module(), SYSCLK_PORT_A, and SYSCLK_PORT_B.

Referenced by adc_disable(), adc_read_configuration(), adc_write_configuration(), adcch_read_configuration(), and adcch_write_configuration().

void adc_enable_clock ( ADC_t *  adc)

Enable peripheral clock for ADC.

Checks if the enable count for the ADC is zero, then increments it. If the count was zero, the peripheral clock is enabled. Otherwise, it is already enabled.

Parameters
adcPointer to ADC module.

References Assert, SYSCLK_ADC, sysclk_enable_module(), SYSCLK_PORT_A, and SYSCLK_PORT_B.

Referenced by adc_enable(), adc_read_configuration(), adc_write_configuration(), adcch_read_configuration(), and adcch_write_configuration().