/****************************************************************************/
/* Copyright 1990 to 1993, MBARI                                            */
/****************************************************************************/
/* Summary  : declarations for sio32 server and microcontroller protocol    */
/* Filename : microCmd.h                                                    */
/* Author   : Andrew Pearce                                                 */
/* Project  : ROV 1.5 Data Concentrator and Moog Motor Micro Communications */
/* Version  : 1.0                                                           */
/* Created  : 10/23/91                                                      */
/* Modified : 04/09/92                                                      */
/* Archived :                                                               */
/****************************************************************************/

#define MICRO_ENABLE_TRYS       5

#ifdef __STDC__

STATUS sendMicroCommand( Reg sio32Chan *sio32Channel, Void *reply,
     Int32 replyLen, Int32 nWords, ... );

STATUS microCommand(Reg sio32Chan *sio32Channel, Word command, Word *value);

Void wordToBuf(Reg Char *buffer, Reg Word data);
Void wordsToBuf(Reg Char *buffer, Int32 nWords, ... );
Word wordFromBuf(Reg Void *buffer, Reg Int16 index);
Void wordsFromBuf(Void *buffer, Int32 nWords, ... );
STATUS microCmdStringReply( Reg sio32Chan *sio32Channel, Word command,
                 Byte *reply, Int16 replyLen );

STATUS microWriteBufReply(sio32Chan *sio32DataChan, Word blen, Byte *buffer);

STATUS microResetCmd( sio32Chan *sio32Channel );
STATUS microCmdEnable( sio32Chan *sio32Channel );
STATUS microGetIdent( sio32Chan *sio32Channel, Char *identString );
STATUS microSerialNo( sio32Chan *sio32Channel, Char *serialNo );
STATUS microSetSerialNo( sio32Chan *sio32Channel, Char *serialNo );
STATUS microSoftwareRev( sio32Chan *sio32Channel, Char *softwareRev );
STATUS microGetRamTest( sio32Chan *sio32Channel, MBool *ramTestStatus );
STATUS microGetWaterAlarm( sio32Chan *sio32Channel, Word *waterAlarmStatus );
STATUS microGetPacketRxTimeout( sio32Chan *sio32DataChan, Nat16 *rxTimeout );
STATUS motorSetPacketRxTimeout( Reg sio32Chan *sio32DataChan, Nat16 rxTimeout);
STATUS microPing( sio32Chan *sio32Channel, Word txSeqNo, Word *rxSeqNo );
STATUS microSetGndFltTestState(sio32Chan *sio32Channel, MBool gfTestState);
STATUS microReadAtoDChansCmd( sio32Chan *sio32Channel, Word atodValues[] );

#endif /* __STDC__ */
