
// this is the header file for REvaLib.c
// prototypes of the functions for easy handling of the REva board


//WARNING: these functions assume that the associated peripherals are already initialized.
// Use RBuilder for that.

//------------------------------------------------------------------
// Analog functions
//------------------------------------------------------------------
// all these functions need to know the reference voltage,
//  which is the alimentation voltage of the ST7.

//this function reads the value from the temperature sensor (in tenth of Celcius degrees)
extern signed short ReadTemp(unsigned short VDDmV);
//this function reads the value from the potentiometer (as a percentage)
extern unsigned char  ReadPot();
//this function reads the value from the analog input IN1 (in mV)
// precision is (VDDmV/1023)
extern unsigned short  ReadI1(unsigned short VDDmV);
//this function reads the value from the analog input IN2 (in mV)
// precision is (VDDmV/1023)
extern unsigned short  ReadI2(unsigned short VDDmV);
//this function sets Vout at NewVal (in mV)
// precision is (VDDmV/255)
extern void SetOUT(unsigned short NewVal, unsigned short VDDmV);

//------------------------------------------------------------------
// utility functions
//------------------------------------------------------------------

//this function converts a hex digit from ascii to binary
extern unsigned char readhex(char car);





