/*H**************************************************************************
* $RCSfile: adc_drv.h,v $
*----------------------------------------------------------------------------
* Copyright (c) 2002 Atmel.
*----------------------------------------------------------------------------
* RELEASE: $Name: DEMO_FAT_1_9_9 $
* REVISION: $Revision: 1.3 $
* FILE_CVSID: $Id: adc_drv.h,v 1.3 2002/05/24 09:51:12 njourdan Exp $
*----------------------------------------------------------------------------
* PURPOSE:
* This file contains the A to D Converter driver definitions
*****************************************************************************/
#ifndef _ADC_DRV_H_
#define _ADC_DRV_H_
/*_____ I N C L U D E S ____________________________________________________*/
/*_____ M A C R O S ________________________________________________________*/
/*_____ D E F I N I T I O N ________________________________________________*/
/*_____ D E C L A R A T I O N ______________________________________________*/
void adc_set_prio (Byte);
#define Adc_set_clock(clock) (ADCLK = clock)
#define Adc_enable() (ADCON |= MSK_ADEN)
#define Adc_disable() (ADCON &= ~MSK_ADEN)
#define Adc_enable_int() (ADCON |= MSK_EADC)
#define Adc_disable_int() (ADCON &= ~MSK_EADC)
#define Adc_ack_conversion() (ADCON &= ~(MSK_ADEOC | MSK_ADCS))
#define Adc_get_data_h() (ADDH)
#define Adc_get_data_l() (ADDL)
#define Adc_start_std(channel) (ADCON |= (MSK_ADSST | channel))
#define Adc_start_idle(channel) (ADCON |= (MSK_ADSST | MSK_ADIDL | channel))
#endif /* _ADC_DRV_H_ */