/****************************************************************************/
/* Copyright 1990, 1991, 1992 MBARI                                         */
/****************************************************************************/
/* Summary  : Ring buffer library declarations for Microcontroller Board    */
/* Filename : ring.h                                                        */
/* Author   : Andrew Pearce                                                 */
/* Project  : Tiburon ROV                                                   */
/* Version  : 1.0                                                           */
/* Created  : 11/21/90                                                      */
/* Modified : 04/02/92                                                      */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/* $Header: /usr/tiburon/.cvsroot/micro/h/ring.h,v 1.1.1.1 1997/05/02 17:15:41 pean Exp $
 * $Log: ring.h,v $
 * Revision 1.1.1.1  1997/05/02 17:15:41  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:52  09:17:52  pean (Andrew Pearce 408-647-3746)
 * Initial revision
 *
*/
/****************************************************************************/

#ifndef RING_H
#define RING_H

typedef struct                          /* RING structure declaration       */
{                                       /* Used for serial data buffering   */
        Byte    *base_ptr;              /* Base address of ring buffer      */
        Byte    *input_ptr;             /* Input pointer - for reads        */
        Byte    *output_ptr;            /* Output pointer - for writes      */
        Byte    *end_ptr;               /* End of ring buffer + 1           */
} Ring;                                 /* Data structure for ring buffer   */

#ifdef __STDC__                         /* ANSI C function prototypes       */

    Void
ring_init( Ring *ring_ptr, Byte *buffer, Nat16 size );

    Int16
ring_put( Ring *ring_ptr, Byte byte );

    Int16
ring_get( Ring *ring_ptr );

    Int16
ring_entries( Ring *ring_ptr );

#endif

#endif
