adc_drv.h File Reference

,vThis file contains the low level macros and definition for the ADC More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#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

,vThis file contains the low level macros and definition for the ADC

Copyright (c) 2004 Atmel.

Please read file license.txt for copyright notice.

Version:
1.5.2.9 at90usb128-demo-hidgen-1_0_0
Todo:
Bug:

Definition in file adc_drv.h.


Generated on Fri Mar 17 16:02:04 2006 for Atmel by  doxygen 1.4.6-NO