/************************************************************************/
/* Copyright 2003-2013 MBARI						*/
/************************************************************************/
/* Summary  : Include file for standalone version of decode program	*/
/* Filename : decodeMain.h						*/
/* Author   : Robert Herlien (rah)					*/
/* Project  : Benthic Event Detection System (BEDS)			*/
/* Revision : 1.0							*/
/* Created  : 2/6/2013							*/
/*									    */
/* MBARI provides this documentation and code "as is", with no warranty,    */
/* express or implied, of its quality or consistency. It is provided without*/
/* support and without obligation on the part of the Monterey Bay Aquarium  */
/* Research Institute to assist in its use, correction, modification, or    */
/* enhancement. This information should not be published or distributed to  */
/* third parties without specific written permission from MBARI.            */
/*									    */
/************************************************************************/
/* Modification History:						*/
/* 6feb2013 rah - created						*/
/************************************************************************/

#ifndef INCdecodeMainh
#define INCdecodeMainh

#include <stdio.h>

#define VREF			2.50
#define RAW_TO_VOLTS(n)		((float)(n) * VREF / 65536.0)
#define RAW_TO_BATTVOLTS(n)	((float)(n) * 12.11* VREF / 65536.0)
#define VOLTS_TO_BATTVOLTS(f)	(12.11*f)
#define VOLTS_TO_TEMP(f)	(100.0*(f-0.5))
#define VOLTS_TO_RH(f)		(50.0*(f-0.5))

typedef enum
{BATT_CHAN, MODEM_MIN_CHAN, EXT_PRESS_CHAN, INT_PRESS_CHAN, TEMP_CHAN, HUMIDITY_CHAN
} ADC_Chans;


/****************************************/
/* Function Declarations		*/
/****************************************/

Nat16	readWord(FILE *fp);
Nat32	readLong(FILE *fp);

#endif	/* INCdecodeMainh */
