ATmega128 On-Chip ADC. More...
![]() |
ATmega128 On-Chip ADC.
#define ADC_PRESCALE_DIV2 0x00 |
#define ADC_PRESCALE_DIV4 0x02 |
#define ADC_PRESCALE_DIV8 0x03 |
#define ADC_PRESCALE_DIV16 0x04 |
#define ADC_PRESCALE_DIV32 0x05 |
#define ADC_PRESCALE_DIV64 0x06 |
#define ADC_PRESCALE_DIV128 0x07 |
#define ADC_INITIAL_MODE SINGLE_CONVERSION |
#define ADC_INITIAL_PRESCALE ADC_PRESCALE_DIV64 |
#define ADC_BUF_SIZE 16 |
Definition at line 114 of file adc.c.
Referenced by ADCBufRead(), ADCBufWrite(), and ADCInit().
#define AVR_SLEEP_CTRL_REG MCUCR |
Definition at line 123 of file adc.c.
Referenced by ADCStartLowNoiseConversion().
#define _adc_buf_head ADC_BUF_SIZE |
Definition at line 141 of file adc.c.
Referenced by ADCBufInit(), ADCBufRead(), and ADCBufWrite().
#define _adc_buf_tail (ADC_BUF_SIZE+1) |
Definition at line 142 of file adc.c.
Referenced by ADCBufInit(), ADCBufRead(), and ADCBufWrite().
typedef enum adc_ref_type adc_ref_t |
typedef enum adc_mode_type adc_mode_t |
typedef enum adc_channel_type adc_channel_t |
enum adc_ref_type |
enum adc_mode_type |
enum adc_channel_type |
void ADCSetRef | ( | adc_ref_t | reference | ) |
Definition at line 213 of file adc.c.
References ADCStopConversion(), AREF, AVCC, cbi, INTERNAL_256, and sbi.
Referenced by ADCInit().
void ADCSetMode | ( | adc_mode_t | mode | ) |
Definition at line 236 of file adc.c.
Referenced by ADCInit(), and ADCStartLowNoiseConversion().
Definition at line 253 of file adc.c.
References ADC_PRESCALE_DIV128, ADC_PRESCALE_DIV16, ADC_PRESCALE_DIV2, ADC_PRESCALE_DIV32, ADC_PRESCALE_DIV4, ADC_PRESCALE_DIV64, ADC_PRESCALE_DIV8, ADCStopConversion(), cbi, and sbi.
Referenced by ADCInit().
void ADCSetChannel | ( | adc_channel_t | adc_channel | ) |
void ADCBufferFlush | ( | void | ) |
Definition at line 316 of file adc.c.
References ADC_buffer, and ADCBufInit().
void ADCStartLowNoiseConversion | ( | void | ) |
Definition at line 326 of file adc.c.
References _BV, adc_sleep_mode, ADCSetMode(), AVR_SLEEP_CTRL_REG, sbi, and SINGLE_CONVERSION.
void ADCStopConversion | ( | void | ) |
Definition at line 346 of file adc.c.
References cbi, current_mode, FREE_RUNNING, and sbi.
Referenced by ADCSetMode(), ADCSetPrescale(), and ADCSetRef().
Definition at line 360 of file adc.c.
References ADC_buffer, and ADCBufRead().
adc_mode_t ADCGetMode | ( | void | ) | [inline] |
Definition at line 365 of file adc.c.
References current_mode.
Definition at line 146 of file adc.c.
References _adc_buf_head, _adc_buf_tail, and ADC_BUF_SIZE.
Definition at line 159 of file adc.c.
References _adc_buf_head, _adc_buf_tail, and ADC_BUF_SIZE.
void ADCBufInit | ( | uint16_t * | buf | ) |
Definition at line 172 of file adc.c.
References _adc_buf_head, and _adc_buf_tail.
Referenced by ADCBufferFlush(), and ADCInit().
uint8_t adc_sleep_mode = SLEEP_MODE_ADC |
Definition at line 117 of file adc.c.
Referenced by ADCStartLowNoiseConversion().
adc_mode_t current_mode = ADC_OFF |
Definition at line 130 of file adc.c.
Referenced by ADCGetMode(), ADCSetMode(), and ADCStopConversion().
uint16_t* ADC_buffer = NULL |
Definition at line 144 of file adc.c.
Referenced by ADCBufferFlush(), ADCInit(), and ADCRead().