XgAt91Adc


Defines

#define AT91_ADC_INITIAL_MODE   SINGLE_CONVERSION
#define AT91_ADC_INITIAL_PRESCALE   55
#define AT91_ADC_BUF_SIZE   16
#define _adc_buf_head   AT91_ADC_BUF_SIZE
#define _adc_buf_tail   AT91_ADC_BUF_SIZE+1

Functions

int ADCBufRead (uint16_t channel, uint16_t *read)
 Reads data from the adc buffer.
void ADCSetMode (TADCMode mode)
 Sets the data aquisition mode for the adc.
void ADCEnableChannel (TADCChannel channel)
 Enable a channel used to sample when conversion started.
void ADCDisableChannel (TADCChannel channel)
 Disable a channel.
void ADCSetPrescale (u_int prescale)
 Set the prescaler for the adc.
void ADCStartConversion (void)
 Start conversion.
void ADCInit (void)
 Initialize the adc to the configured default values and enable interrupt.

Variables

uint16_t ** ADC_Buffer = NULL


Define Documentation

#define AT91_ADC_INITIAL_MODE   SINGLE_CONVERSION

Definition at line 62 of file at91_adc.c.

Referenced by ADCInit().

#define AT91_ADC_INITIAL_PRESCALE   55

Definition at line 66 of file at91_adc.c.

Referenced by ADCInit().

#define AT91_ADC_BUF_SIZE   16

Definition at line 69 of file at91_adc.c.

Referenced by ADCBufRead(), and ADCInit().

#define _adc_buf_head   AT91_ADC_BUF_SIZE

Definition at line 71 of file at91_adc.c.

#define _adc_buf_tail   AT91_ADC_BUF_SIZE+1

Definition at line 72 of file at91_adc.c.


Function Documentation

int ADCBufRead ( uint16_t  channel,
uint16_t read 
)

Reads data from the adc buffer.

Parameters:
channel Specifies the channel to read data from
read Variable to store the data in
Returns:
0: data read succesfully, 1: no data available

Definition at line 84 of file at91_adc.c.

References _adc_buf_head, _adc_buf_tail, ADC_Buffer, and AT91_ADC_BUF_SIZE.

Referenced by ADCRead().

void ADCSetMode ( TADCMode  mode  ) 

void ADCEnableChannel ( TADCChannel  channel  ) 

Enable a channel used to sample when conversion started.

Parameters:
channel Specifies the channel to enable

Definition at line 158 of file at91_adc.c.

References _BV, ADC_CHER, ADC_IER, and outr.

void ADCDisableChannel ( TADCChannel  channel  ) 

Disable a channel.

Parameters:
channel Specifies the channel to disable

Definition at line 170 of file at91_adc.c.

References _BV, ADC_CHER, ADC_IDR, and outr.

void ADCSetPrescale ( u_int  prescale  ) 

Set the prescaler for the adc.

Parameters:
prescale Prescaler value 0-128

Definition at line 182 of file at91_adc.c.

References ADC_MR, ADC_PRESCAL, ADC_PRESCAL_LSB, ADC_SHTIM, ADC_STARTUP, inr, and outr.

void ADCStartConversion ( void   ) 

Start conversion.

Definition at line 196 of file at91_adc.c.

References ADC_CR, ADC_START, outr, and sbi.

void ADCInit ( void   ) 


Variable Documentation

uint16_t** ADC_Buffer = NULL

Definition at line 74 of file at91_adc.c.

Referenced by ADCBufRead(), and ADCInit().


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