/****************************************************************************/
/* Copyright 1990, 1991, 1992 MBARI                                         */
/****************************************************************************/
/* Summary  : Application layer interface to microcontroller communications */
/* Filename : applay.h                                                      */
/* Author   : Andrew Pearce                                                 */
/* Project  : Tiburon ROV                                                   */
/* Version  : 1.0                                                           */
/* Created  : 04/06/92                                                      */
/* Modified : 04/06/92                                                      */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/* $Header: /usr/tiburon/.cvsroot/micro/h/applay.h,v 1.1.1.1 1997/05/02 17:15:36 pean Exp $
 * $Log: applay.h,v $
 * Revision 1.1.1.1  1997/05/02 17:15:36  pean
 * Initial release of the microcontroller software after Tiburon
 * Moolpool Dive to test IView, Lapboxes, modified Power can
 * GF/5V using bus capacitance mode.
 *
 * Revision 1.1  92/05/14  09:17:45  09:17:45  pean (Andrew Pearce 408-647-3746)
 * Initial revision
 *
*/
/****************************************************************************/

#ifndef APPLAY_H
#define APPLAY_H

#define MAX_REPLY_WORDS   20

#ifdef __STDC__                    /* ANSI C function prototypes            */

Void wordToBuf(Byte *buffer, Word data);

Word wordFromBuf(Byte *buffer, Int16 index);

Void wordsToBuf(Byte *buffer, Int16 nWords, ... );

Void wordsFromBuf(Byte *buffer, Int16 nWords, ... );

Void initSerialProtocol( Void (*disconnectFunc) () );

Void freeRecvdPacket(Byte *packet);

Int16 writeWordPacket(Word value);

Int16 acknowledgeCommand(Word value);

Int16 writeServiceRequest(Int16 nWords, ...);

Int16 replyToCommand(Int16 nWords, ... );

Int16 writeDataPacket(Byte *packet, Int16 packetLen);

Int16 writeSRQPacket(Byte *packet, Int16 packetLen);

#endif

#endif
