adc.c File Reference

AVR adc driver. More...

Go to the source code of this file.

Defines

#define ADC_INITIAL_CHANNEL   ADC0
#define ADC_INITIAL_REF   AVCC
#define ADC_INITIAL_MODE   SINGLE_CONVERSION
#define ADC_INITIAL_PRESCALE   ADC_PRESCALE_DIV64
#define ADC_BUF_SIZE   16
#define AVR_SLEEP_CTRL_REG   MCUCR
#define _adc_buf_head   ADC_BUF_SIZE
#define _adc_buf_tail   (ADC_BUF_SIZE+1)

Functions

int ADCBufRead (uint16_t *buf, uint16_t *read)
int ADCBufWrite (uint16_t *buf, uint16_t *write)
void ADCBufInit (uint16_t *buf)
void ADCInit (void)
 Initialize the adc to the configured default values and enable interrupt.
void ADCSetRef (adc_ref_t reference)
void ADCSetMode (adc_mode_t mode)
uint8_t ADCSetPrescale (uint8_t prescalar)
void ADCSetChannel (adc_channel_t adc_channel)
void ADCBufferFlush (void)
void ADCStartConversion (void)
 Start conversion.
void ADCStartLowNoiseConversion (void)
void ADCStopConversion (void)
uint8_t ADCRead (uint16_t *value)
adc_mode_t ADCGetMode (void)

Variables

uint8_t adc_sleep_mode = SLEEP_MODE_ADC
adc_mode_t current_mode = ADC_OFF
uint16_tADC_buffer = NULL


Detailed Description

AVR adc driver.

Definition in file adc.c.


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/