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 (u_short channel, u_short *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 | |
u_short ** | ADC_Buffer = NULL |
#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 |
Definition at line 68 of file at91_adc.c.
#define _adc_buf_tail AT91_ADC_BUF_SIZE+1 |
Definition at line 69 of file at91_adc.c.
Reads data from the adc buffer.
channel | Specifies the channel to read data from | |
read | Variable to store the data in |
Definition at line 81 of file at91_adc.c.
References _adc_buf_head, _adc_buf_tail, ADC_Buffer, and AT91_ADC_BUF_SIZE.
void ADCSetMode | ( | TADCMode | mode | ) |
Sets the data aquisition mode for the adc.
mode | Mode to set |
Definition at line 115 of file at91_adc.c.
References ADC_MR, ADC_OFF, ADC_SLEEP, ADC_TRGEN, ADC_TRGSEL, ADC_TRGSEL_EXT, ADC_TRGSEL_TIOA0, ADC_TRGSEL_TIOA1, ADC_TRGSEL_TIOA2, FREE_RUNNING_EXT, FREE_RUNNING_T0, FREE_RUNNING_T1, FREE_RUNNING_T2, inr, outr, and SINGLE_CONVERSION.
void ADCEnableChannel | ( | TADCChannel | channel | ) |
void ADCDisableChannel | ( | TADCChannel | channel | ) |
void ADCSetPrescale | ( | u_int | prescale | ) |
Set the prescaler for the adc.
prescale | Prescaler value 0-128 |
Definition at line 179 of file at91_adc.c.
References ADC_MR, ADC_PRESCAL, ADC_PRESCAL_LSB, ADC_SHTIM, ADC_STARTUP, inr, and outr.
void ADCStartConversion | ( | void | ) |
void ADCInit | ( | void | ) |
Initialize the adc to the configured default values and enable interrupt.
Definition at line 222 of file at91_adc.c.
References _adc_buf_head, _adc_buf_tail, _BV, ADC_Buffer, ADC_CH0, ADC_CH1, ADC_CH2, ADC_CH3, ADC_CH4, ADC_CH5, ADC_CH6, ADC_CH7, ADC_CHDR, ADC_CR, ADC_ID, ADC_SWRST, ADCSetMode(), ADCSetPrescale(), AT91_ADC_BUF_SIZE, AT91_ADC_INITIAL_MODE, AT91_ADC_INITIAL_PRESCALE, NutHeapAlloc(), NutIrqEnable(), NutRegisterIrqHandler(), outr, PMC_PCER, and sig_ADC.
u_short** ADC_Buffer = NULL |