/******************************************************************************/
/* Copyright 1992 MBARI                                                       */
/******************************************************************************/
/* Summary  : Moog Thruster Motor Controller Command Module for VxWorks       */
/* Filename : moog.h                                                          */
/* Author   : Andrew Pearce                                                   */
/* Project  : New ROV                                                         */
/* Version  : Version 1.0                                                     */
/* Created  : 06/15/92                                                        */
/* Modified : 09/22/95                                                        */
/* Archived :                                                                 */
/******************************************************************************/
/* Modification History:                                                      */
/* $Header: moog.h,v 1.2 93/07/01 14:39:10 pean Exp $
 * $Log:	moog.h,v $
 * Revision 1.2  93/07/01  14:39:10  14:39:10  pean (Andrew Pearce)
 * *** empty log message ***
 * 
 * Revision 1.1  92/06/29  10:18:24  10:18:24  pean (Andrew Pearce 408-647-3746)
 * Initial revision
 * 
 */
/******************************************************************************/

#define MAX_CMD_THRUST	1245	    /* Maxiumum thrust value sent to motor    */

#ifdef __STDC__		 	    /* ANSI Function protottypes              */

motorFaultStatus SRQToMotorStatus( Word motorStatusSRQ );

STATUS motorGetTemperature( sio32Chan *sio32DataChan, Int16 *temperature );
STATUS motorGetTempAlarm(sio32Chan *sio32DataChan, microAlarm *tempAlarmStatus);

STATUS motorSerialNo(sio32Chan *sio32DataChan, Char *serialNo);

STATUS motorGetMotorStatus( sio32Chan *sio32DataChan,
     motorFaultStatus *motorStatus );

STATUS motorGetFoldbackStatus( sio32Chan *sio32DataChan, MBool
	 *motorFoldbackStatus );

STATUS motorGetVelocity( sio32Chan *sio32DataChan, Int16 *motorVelocity );

STATUS motorSetMotorEnable( sio32Chan *sio32DataChan, MBool motorStatus );

STATUS motorGetCtrlMode( sio32Chan *sio32DataChan, motorCtrlMode *controlMode );
STATUS motorSetCtrlMode( sio32Chan *sio32DataChan, motorCtrlMode controlMode );

STATUS motorSetCmdThrust( Reg sio32Chan *sio32DataChan, Reg Int16 cmdThrust );
STATUS motorSetCmdThrustPower( Reg sio32Chan *sio32DataChan,
		 Reg Int16 cmdThrust, Reg Int16 cmdPower );

STATUS motorGetTorqueOffset( sio32Chan *sio32DataChan, Int16 *torqueOffset );
STATUS motorSetTorqueOffset( sio32Chan *sio32DataChan, Int16 torqueOffset );

STATUS motorGetCurrentGain( sio32Chan *sio32DataChan, Int16 *currentGain);  
STATUS motorSetCurrentGain( sio32Chan *sio32DataChan, Int16 currentGain);  
STATUS motorGetTorqueGain( sio32Chan *sio32DataChan, Int16 *torqueGain );
STATUS motorSetTorqueGain( sio32Chan *sio32DataChan, Int16 torqueGain );

STATUS motorGetVelocityGains( sio32Chan *sio32DataChan,
     velocity_gains *velocityGains );

STATUS motorSetVelocityGains( sio32Chan *sio32DataChan,
     velocity_gains velocityGains );

STATUS motorGetLinearizedGains( sio32Chan *sio32DataChan,
     linearized_gains *linearizedGains );

STATUS motorSetLinearizedGains( sio32Chan *sio32DataChan,
     linearized_gains linearizedGains );

STATUS motorGetModelParamK4( sio32Chan *sio32DataChan, Int16 *modelParamK4 );
STATUS motorSetModelParamK4( sio32Chan *sio32DataChan, Int16 modelParamK4 );

STATUS motorWriteNVRam( sio32Chan *sio32DataChan );
STATUS motorGetNVRamDate( sio32Chan *sio32DataChan, char *dateTime );
STATUS motorGetNVRamCycles( sio32Chan *sio32DataChan, Word *NVRamWriteCycles );

STATUS motorSetTempAlarmThresh( Reg sio32Chan *sio32DataChan,
    Int16 warnThresh, Int16 alarmThresh );

STATUS motorGetTempAlarmThresh( sio32Chan *sio32DataChan,
    Int16 *warnThresh, Int16 *alarmThresh );

STATUS motorSetCmdPower(Reg sio32Chan *sio32DataChan, Reg Int16 commandedPower);
STATUS motorSetRegenMode( sio32Chan *sio32DataChan, MBool regenMode);
STATUS motorGetRegenLimit( sio32Chan *sio32DataChan, Int16 *regenLimit );
STATUS motorSetRegenLimit( Reg sio32Chan *sio32DataChan, Int16 regenLimit );
STATUS motorGetWaterAlarm( sio32Chan *sio32DataChan, Word *waterAlarmStatus );

STATUS motorSetWaterAlarmThresh( sio32Chan *sio32DataChan,
     Int16 waterAlarmThresh );

STATUS motorGetWaterAlarmThresh( sio32Chan *sio32DataChan,
     Int16 *waterAlarmThresh );

STATUS motorRpmCalibrate( sio32Chan *sio32DataChan );
STATUS motorEnableVelBuf( sio32Chan *sio32DataChan );
STATUS motorReadVelBuf( sio32Chan *sio32DataChan, Int16 velData[],
     Int16 torqueData[] );

#endif /* __STDC__ */
