/****************************************************************************/
/* Copyright 1991 to 1995, MBARI                                            */
/****************************************************************************/
/* Summary  : Sonar Data Concetrator - Main C Source file                   */
/* Filename : sonar.h                                                       */
/* Author   : Douglas Au                                                    */
/* Project  : New ROV IBC Based Data Concentrator                           */
/* Version  : 1.0                                                           */
/* Created  : 10/10/95                                                      */
/* Modified : 10/10/95                                                      */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/* $Header: /usr/tiburon/.cvsroot/micro/h/sonar.h,v 1.1.1.1 1997/05/02 17:15:41 pean Exp $
 * $Log: sonar.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  96/02/20  14:26:24  14:26:24  audo (Douglas Au)
 * Initial revision
 *
 * Initial revision
*/
/****************************************************************************/

                                        /* Sonar IBC A/D Channel Assignment */
#define HUMIDITY_SENSOR_CHAN        0   /* Humidity Sensor Channel          */
#define HOUSING_WATER_ALARM_CHAN    1   /* Housing Water Alarm Channel      */
#define JBOX_WATER_ALARM_CHAN       2   /* J-Box Water Alarm Channel        */
#define SPARE_ATOD_CHAN             3   /* Spare A/D channel                */

                                        /* Sonar IBC Quad Serial Channels  */
#define ALTIMETER_SERIAL_CHAN       0   /*  Serial Channel    */
#define ROVNAV_SERIAL_CHAN          1   /*  Chan        */
#define ADV_IN_SERIAL_CHAN          2   /*  Chan     */
#define ADV_OUT_SERIAL_CHAN         3   /*  Chan*/

#define HOUSING_WATER_ALARM_BIT  0x01   /* Housing Water Alarm Status Bit   */
#define JBOX_WATER_ALARM_BIT     0x02   /* J-Box Water Alarm Status Bit     */

                                        /* Water Alarm Threshold is 0.5V    */
#define WATER_ALARM_THRESHOLD     103   /* 103 = 2^10 * 0.5/5.0             */
#define WATER_ALARM_HYSTERESIS     10   /* 10 counts = 0.049 volts          */

                                        /* ** Sonar IBC Serial Commands  ** */
#define GET_WATER_ALARM          0x01   /* Get Water Alarm Status Word      */
#define GET_WATER_ALARM_THRESH   0x02   /* Get Water Alarm Threshold Value  */
#define SET_WATER_ALARM_THRESH   0x03   /* Set Water Alarm Threshold Value  */
#define GET_SENSOR_DATA          0x04   /* Get Sensor Measurements          */
#define GET_ALTIMETER_RANGE      0x05   /* Get Altimeter Range              */
#define SET_ALTIMETER_RANGE      0x06   /* Set Altimeter Range              */
#define GET_ALTIMETER_GAIN       0x07   /* Get Altimeter Range              */
#define SET_ALTIMETER_GAIN       0x08   /* Set Altimeter Range              */


#define CAN_WATER_ALARM_ON_SRQ    APPLIC_SRQ_BASE | 0xC0
#define CAN_WATER_ALARM_OFF_SRQ   APPLIC_SRQ_BASE | 0xC1

#define JBOX_WATER_ALARM_ON_SRQ   APPLIC_SRQ_BASE | 0xC2
#define JBOX_WATER_ALARM_OFF_SRQ  APPLIC_SRQ_BASE | 0xC3











