/* ---------------------------------------------------------------------
**	file: ADC_driver.h
**	function: ADC driver header file
** author: Jakub Tiller
** last update: 30.11.2011
** ---------------------------------------------------------------------
*/

#ifndef _ADC_REF
#define _ADC_REF
#include <stdio.h>
#include <util/delay.h>
#include <avr/io.h>
#include "../global/global.h" 


#define VREF	5*V
#define NUM_OF_ADCs 2		//count of used ADC's

// define only if need sprintf function
//#define _SPRINTF

enum AREF_t{
	INTERNAL = 0,
	EXT_AVCC,
	EXT_VREF
};

enum GAIN_t{
	g10 = 10,
	g200 = 200
};

char voltage[5];

void adc_init(enum AREF_t AREF);
unsigned int adc_get(unsigned char ADCx);
char* adc_get_Voltage_str(unsigned char ADCx);
void adc_stop(void);
void adc_set_diff(unsigned char ADCx);
unsigned int adc_get_diff(void);
void adc_set_diff_1_0_gain(enum GAIN_t gain);
unsigned int adc_diff_1_0_gain(void);

#endif
