/****************************************************************************                                                                        ***  FILE        :  mvp.h        		                                  ***                                                                        ***  DESCRIPTION :  Header file for main code to control the MBARI		  ***					Vertical Profiler 							          ***                                                                        ***  COPYRIGHT   :  2000 Monterey Bay Aquarium Research Institute          ***                                                                        ***	REVISION HISTORY:													  ***		1.0.0	Initial release (prm)									  ***************************************************************************/#ifndef		__mvp_H#define		__mvp_H#define VERSION "1.14.0"#define PROMPT  "\nMVP> "#define MXLINE  80			/* max command line length */#define MXARGS	3			/* max number of command line arguments */#define TRUE    1#define FALSE   0#define ON		1#define OFF		0#define FORWARD	1#define REVERSE	0#define NUMCOMMANDS (sizeof(commands)/sizeof(commands[0]))#define CMD_BUF_SIZE    132#define NO_VAL	32767		/* indicates no value for command argument */#define BS		0x08		/* backspace char */#define ESC		0x1b		/* escape char */#define MTR_CUR	0			/* A/D chan for motor current */#define POT_POS	1			/* A/D chan for pot position */#define MTR_PWM	15			/* TPU chan for motor pwm */#define PWM_PER	400			/* PWM period, 250 ns per count for 16 MHz clk */#define PWM_STEP	10		/* number of PWM counts to increase each 100 ms */#define NUMSAMPS	16		/* number of AtoD samples to average */#define LOLIM	614			/* lower limit of engine travel on 0-4095 scale */#define UPLIM	3614		/* upper limit of engine travel on 0-4095 scale */#define RANGE	(UPLIM-LOLIM)	/* total range of allowed motion */#define HALF_PCT	RANGE/200	/* 0.5% of total range */#define ONE_PCT		RANGE/100	/* 1% of total range */#define FIVE_PCT	RANGE/20	/* 5% of total range */#define PITDLY 2			/* delay time for periodic interrupt (102.4 msec) */#define DEPLOYDLY	10		/* number of minutes to pause before deployment starts */#define SETDLY	86400L		/* delay between sets in seconds */#define DEPTHDLY	14		/* delay in seconds between depth readings */#define STOPDLY		8		/* number of depth reading to delay before stopping instruments */#define CASTTIMEOUT	360		/* number of depth readings before BP is shut off to save battery */#define SLEEPFREQ	320000L	/* clock freq during sleep */#define AWAKEFREQ	8000000L	/* clock freq while awake */#define UPONLY	TRUE		/* run instruments on upcast only *//*  P R O T O T Y P E S  */void Init(void);void SetEngPos(short);void StartEngine(short);void ReadEngPos(void);void ReadVehDepth(void);short Cnt2Pct(short);short Pct2Cnt(short);void SetModeDeploy(void);void SetModeYoyo(short, short, short);void TransparentSerial(short);void SetClkTime(void);void ReadClkTime(void);void PrintTime(struct tm*);void TestInstrLog(void);int MyQueryDateTime(char *, struct tm*);int QueryDate(char *, struct tm*);int QueryTime(char *, long *);int TimedGetLine(char *, int);void Help(void);void GoToSleep(time_tt);void EnaDCDrive(void);void DisDCDrive(void);void SoftStart(short *);short AtoDReadAvg(short, short);void GetLine(char *, int);void DoCommand(void);short ParseCommand(void);void MakeWordUpper(char *);void PrepPinsLowPower(void);void InitPeriodicTimerInterrupt(void);void SetPeriodicTimer(int delay);void ServicePeriodicTimerInterrupt(void);extern int gTimeDly;#endif	/* __mvp_H */