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 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 71 of file at91_adc.c.
#define _adc_buf_tail AT91_ADC_BUF_SIZE+1 |
Definition at line 72 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 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 | ) |
Sets the data aquisition mode for the adc.
mode | Mode to set |
Definition at line 118 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, ADCStopConversion(), cbi, current_mode, FREE_RUNNING, FREE_RUNNING_EXT, FREE_RUNNING_T0, FREE_RUNNING_T1, FREE_RUNNING_T2, inr, outr, sbi, and SINGLE_CONVERSION.
Referenced by ADCInit(), and ADCStartLowNoiseConversion().
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 182 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 225 of file at91_adc.c.
References _adc_buf_head, _adc_buf_tail, _BV, ADC_BUF_SIZE, ADC_buffer, 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_INITIAL_CHANNEL, ADC_INITIAL_MODE, ADC_INITIAL_PRESCALE, ADC_INITIAL_REF, ADC_SWRST, ADCBufInit(), ADCSetChannel(), ADCSetMode(), ADCSetPrescale(), ADCSetRef(), AT91_ADC_BUF_SIZE, AT91_ADC_INITIAL_MODE, AT91_ADC_INITIAL_PRESCALE, NutHeapAlloc(), NutIrqEnable(), NutRegisterIrqHandler(), outr, PMC_PCER, sbi, and sig_ADC.
uint16_t** ADC_Buffer = NULL |