/************************************************************************/
/* Copyright (c) 1989 Montery Bay Aquarium Research Institute (MBARI)   */
/*   All Rights Reserved                                                */
/************************************************************************/

/************************************************************************/
/* Name     : Definitions for Sony Video Tape Recorder                  */
/* Filename : SONY.H                                                    */
/* Author   : Robert Herlien                                            */
/* Product  : Video Tape to Video Disk Recording                        */
/* Version  : Unreleased                                                */
/* Created  : 07/06/89                                                  */
/* Modified : 07/21/89                                                  */
/* Archived :                                                           */
/************************************************************************/

/*                              */
/*  Miscellaneous Definitions   */
/*                              */

#define SONY_RETRIES    3               /* Number times command is retried*/

#define LFRAMES_PER_SEC 30L             /* (Long) frames per second     */
#define LFRAMES_PER_MIN 1800L           /* (Long) frames per minute     */
#define LFRAMES_PER_HR  108000L         /* (Long) frames per hour       */


/*                              */
/*  Sony Error Definitions      */
/*                              */

#define ES_NOERROR       0              /* No error on last command      */
#define ES_INVALID       1              /* Invalid command sent          */
#define ES_CHECKSUM      2              /* Command to Sony had checksum err*/
#define ES_PARITY        3              /* Command to Sony had bad parity*/
#define ES_OVERRUN       4              /* Command overran Sony's buffer */
#define ES_FRAMING       5              /* Sony reports framing error    */
#define ES_SONY_TIMEOUT  6              /* Command to Sony timed out     */
#define ES_SERWRITE      7              /* Serial port error in writing  */
                                        /*  to Sony                      */
#define ES_REPLY_TIMEOUT 8              /* Timeout on receiving Sony reply*/
#define ES_PROTOCOL      9              /* Bad reply from Sony           */


/*                              */
/*  Sony Status Bit Definitions */
/*                              */

/* One or more of following bits may be set on return from sony_status()*/
#define STS_LOCAL       (0x01L)         /* Remote/Local switch set to Local*/
#define STS_HW_ERROR    (0x04L)         /* Pwr supply, motor, or tape error*/
#define STS_TAPE_TROUBLE (0x08L)        /* Tape transport problem          */
#define STS_SERVO_REF   (0x10L)         /* Servo Reference signal missing  */
#define STS_UNTHREAD    (0x20L)         /* Tape is released (unthreaded)   */
#define STS_BAD_COMM    (0x80L)         /* Bad serial I/O in getting status*/
#define STS_PLAY        (0x100L)        /* Sony in PLAY or RECORD mode     */
#define STS_RECORD      (0x200L)        /* Sony in RECORD mode             */
#define STS_FAST_FWD    (0x400L)        /* Sony in FAST FORWARD mode       */
#define STS_REWIND      (0x800L)        /* Sony REWINDing                  */
#define STS_STOP        (0x2000L)       /* Sony STOPped                    */
#define STS_STANDBY     (0x8000L)       /* Stopped but tape threaded       */
                                        /* Don't know how differs from STILL*/
#define STS_CUE_UP      (0x10000L)      /* Unused                          */
#define STS_STILL       (0x20000L)      /* Showing STILL frame             */
#define STS_DIRECTION   (0x40000L)      /* Direction of last tape movemt   */
                                        /* 0 = forward, 1 = reverse        */
#define STS_VARSPEED    (0x80000L)      /* Variable (non-normal) speed     */
#define STS_JOG         (0x100000L)     /* Jog mode - Unused               */
#define STS_SHUTTLE     (0x200000L)     /* Shuttle mode - Unused           */
#define STS_TSO         (0x400000L)     /* TSO mode - Unused               */
#define STS_SERVO_LOCK  (0x800000L)     /* Drum Servo locked               */
#define STS_TAPE_END   (0x4000000L)     /* End of tape reached */


/*                                              */
/* Declarations of Functions in SONY.C          */
/*                                              */
