//! @file $RCSfile: adc_drv.c,v $
//!
//! Copyright (c) 2004 Atmel.
//!
//! Please read file license.txt for copyright notice.
//!
//! @brief This file contains the low level functions for the ADC
//!
//! @version $Revision: 1.3.2.6 $ $Name: demo-bldc-sensor-at90pwm3-4_6_0 $ $Id: adc_drv.c,v 1.3.2.6 2006/03/22 18:00:19 rletendu Exp $
//!
//! @todo
//! @bug

//_____  I N C L U D E S ___________________________________________________

#include "config.h"

#ifdef USE_ADC //!< this define is set on config.h file
#include "adc_drv.h"

//_____ M A C R O S ________________________________________________________


//_____ P R I V A T E    D E C L A R A T I O N _____________________________


//_____ D E F I N I T I O N ________________________________________________


//_____ D E C L A R A T I O N ______________________________________________
//! Configures the ADC accordingly to the ADC Define Configuration values.
//! Take care that you have to select the ports which will be converted as
//! analog inputs thanks to the DIDR0 and DIDR1 registers.
//!
void init_adc(void)
{
	Left_adjust_adc_result();
	Enable_vcc_vref();
	ADCB.CH0MUXCTRL = (U8) ADC_MUXPOS_PIN1_gc | ADC_INPUTMODE_SINGLEENDED_gc;
	
	Enable_adc();
}
#endif // USE_ADC
