adc_drv.h File Reference

Go to the source code of this file.

Defines

#define ADHSM   7
#define Enable_adc()   (ADCSRA |= (1<<ADEN))
#define Right_adjust_adc_result()   (ADMUX &= ~(1<<ADLAR))
#define Left_adjust_adc_result()   (ADMUX |= (1<<ADLAR))
#define Enable_adc_high_speed_mode()   (ADCSRB |= (1<<ADHSM))
#define Disable_adc_high_speed_mode()   (ADCSRB &= ~(1<<ADHSM))
#define Enable_internal_vref()   (ADMUX |= ((1<<REFS1)|(1<<REFS0)) )
#define Enable_external_vref()   (ADMUX &= ~((1<<REFS1)|(1<<REFS0)) )
#define Enable_vcc_vref()
#define Enable_all_it()   (SREG |= (0x80) )
#define Disable_all_it()   (SREG &= ~(0x80) )
#define Enable_adc_it()   (ADCSRA |= (1<<ADIE) )
#define Disable_adc_it()   (ADCSRA &= ~(1<<ADIE) )
#define Clear_adc_flag()   (ADCSRA &= (1<<ADIF) )
#define Set_prescaler(prescaler)
#define Clear_adc_mux()   (ADMUX &= ~((1<<MUX3)|(1<<MUX2)|(1<<MUX1)|(1<<MUX0)) )
#define Select_adc_channel(channel)   (Clear_adc_mux(), ADMUX |= (channel) )
#define Start_conv()   (ADCSRA |= (1<<ADSC) )
#define Start_conv_channel(channel)   (Select_adc_channel(channel), Start_conv() )
#define Start_amplified_conv()   (ADCSRB |= (1<<ADASCR) )
#define Stop_amplified_conv()   (ADCSRB &= ~(1<<ADASCR) )
#define Start_amplified_conv_channel(channel)   (Select_adc_channel(channel), Start_amplified_conv() )
#define Start_conv_idle()   (SMCR |= (1<<SM0)|(1<<SE) )
#define Start_conv_idle_channel(channel)   (Select_adc_channel(channel), Start_conv_idle() )
#define Clear_sleep_mode()   (SMCR &= ~(1<<SM0)|(1<<SE) )
#define Adc_get_8_bits_result()   ((U8)(ADCH))
#define Adc_get_10_bits_result()   ((U16)(ADCL+((U16)(ADCH<<8))))
#define Disable_adc()   (ADCSRA &= ~(1<<ADEN))
#define Is_adc_conv_finished()   ((ADCSRA & (1<<ADIF)) ? TRUE : FALSE)
#define Is_adc_conv_not_finished()   ((ADCSRA | ~(1<<ADIF)) ? TRUE : FALSE)

Functions

void init_adc (void)
 Configures the ADC accordingly to the ADC Define Configuration values.


Detailed Description

This file contains the low level macros and definition for the ADC - Compiler: IAR EWAVR and GNU GCC for AVR

Definition in file adc_drv.h.


Define Documentation

#define ADHSM   7

Definition at line 47 of file adc_drv.h.


Generated on Wed Sep 23 09:17:03 2009 for ATMEL by  doxygen 1.5.3