/****************************************************************************/
/* Copyright 1994 to 1995 MBARI                                             */
/****************************************************************************/
/* Summary  : AC Cam Microcontroller Board Application definitions          */
/* Filename : ac_micro.h                                                    */
/* Author   : Andrew Pearce                                                 */
/* Project  : Tiburon ROV                                                   */
/* Version  : Version 1.0                                                   */
/* Created  : 03/13/95                                                      */
/* Modified : 03/13/95                                                      */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/* $Header: /usr/tiburon/.cvsroot/micro/h/ac_micro.h,v 1.1.1.1 1997/05/02 17:15:36 pean Exp $
 * $Log: ac_micro.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.3  95/09/13  11:31:39  11:31:39  pean (Andrew Pearce)
 * Final release for Tiburon
 *
 * Revision 1.2  95/04/25  09:45:39  09:45:39  pean (Andrew Pearce)
 * Pressure sensor resolution changed to 0.01 PSIA
 *
 * Revision 1.1  95/03/27  16:14:58  16:14:58  pean (Andrew Pearce)
 * Initial revision
 *
*/
/****************************************************************************/

#ifndef AC_MICRO_H
#define AC_MICRO_H


#define TEMP_WARN_THRESH          60    /* Temperature Warn Threshold degs  */
#define TEMP_ALARM_THRESH         75    /* Temperature Alarm Threshold degs */
#define TEMPERATURE_HYSTERESIS     5    /* Temeprature Alarm Hystesis degs  */
#define MAX_TEMP_VALUE           120    /* Maximum temperature measurement  */

#define HUMIDITY_WARN_THRESH      10    /* Set humidity warning to 10% RH   */
#define HUMIDITY_ALARM_THRESH     20    /* Set humidity alarm to 20% RH     */
#define HUMIDITY_HYSTERESIS        2    /* Humidity sensor hysteresis 2%    */

#define PRESSURE_WARN_THRESH    1500    /* Pressure Warn Threshold PSI * 100*/
#define PRESSURE_ALARM_THRESH   2500    /* Pressure Alarm Threshold PSI* 100*/
#define PRESSURE_HYSTERESIS      200    /* Pressure Alarm Hystesis PSI * 100*/
#define MAX_PRESSURE_VALUE      5000    /* Maxpressure measurement PSI * 100*/

#define TANK_LEVEL_ALARM_THRESH 2500    /* Tank level alarm threshold       */
#define TANK_LEVEL_HYSTERESIS    150    /* Hystersis for coolant level      */
#define MAX_LEVEL_VALUE        10000    /* Maximum coolant level (mV)       */

#define ONE_SECOND               100    /* 1 second in ticker units         */
#define PUMP_ON_TIME              60    /* Pump on for 60 seconds           */
#define PUMP_OFF_TIME              5    /* Pump off for 5 seconds           */
#define PUMP_CONTROL_BIT         0x1    /* Pump Control uses P1.0           */

                                            /* *** Micro A/D Channels ***   */
#define TEMPERATURE_SENSOR_CHAN     0   /* Temperature sensor               */
#define AC_CAN_WATER_ALARM_CHAN     1   /* AC Can Water Alarm sensor        */
#define AC_CAN_PRESSURE_CHAN        2   /* AC Can Pressure sensor           */
#define TETHER_CAN_WATER_ALARM_CHAN 3   /* Tether Can Water Alarm sensor    */
#define INBD_TANK_LEVEL_CHAN        4   /* Inboard Tank Level sensor        */
#define INBD_SUMP_LEVEL_CHAN        5   /* Inboard Sump level sensor        */
#define OUTBD_TANK_LEVEL_CHAN       6   /* Outboard Tank Level sensor       */
#define OUTBD_SUMP_LEVEL_CHAN       7   /* Outboard Sump level sensor       */

#define GET_TEMPERATURE           0x01  /* Get Temperature Sensor Value     */
#define GET_TEMP_ALARM_STATUS     0x02  /* Get Temperature Alarm Status     */
#define GET_TEMP_ALARM_THRESH     0x03  /* Get Temperature Alarm Threshold  */
#define SET_TEMP_ALARM_THRESH     0x04  /* Set Temperature Alarm Threshold  */

#define GET_HUMIDITY              0x05  /* Get Humidity Sensor Reading      */
#define GET_HUMIDITY_ALARM        0x06  /* Get Humidity Alarm Status        */
#define GET_HUMIDITY_THRESH       0x07  /* Get Humidity Alarm Threshold     */
#define SET_HUMIDITY_THRESH       0x08  /* Set Humidity Alarm Threshold     */

#define GET_WATER_ALARM           0x09  /* Get water alarm status word      */

#define GET_PRESSURE              0x0a  /* Get Pressure Sensor Value        */
#define GET_PRESSURE_ALARM_STATUS 0x0b  /* Get Pressure Alarm Status        */
#define GET_PRESSURE_ALARM_THRESH 0x0c  /* Get Pressure Alarm Threshold     */
#define SET_PRESSURE_ALARM_THRESH 0x0d  /* Set Pressure Alarm Threshold     */
#define GET_COOLANT_LEVELS        0x0e  /* Get Coolant Level Measurements   */
#define GET_COOLANT_ALARM_STATUS  0x0f  /* Get Coolant Level Alarm Thresh   */
#define GET_COOLANT_ALARM_THRESH  0x10  /* Get Coolant Level Alarm Thresh   */
#define SET_COOLANT_ALARM_THRESH  0x11  /* Set Coolant Level Alarm Thresh   */

                                  /* AC Can Micro Applic Service Requests   */
#define HUMIDITY_ALARM_SRQ               APPLIC_SRQ_BASE | 0x01
#define TEMPERATURE_ALARM_SRQ            APPLIC_SRQ_BASE | 0x02
#define PRESSURE_ALARM_SRQ               APPLIC_SRQ_BASE | 0x03
#define TETHER_CAN_WATER_ALARM_ON_SRQ    APPLIC_SRQ_BASE | 0x04
#define TETHER_CAN_WATER_ALARM_OFF_SRQ   APPLIC_SRQ_BASE | 0x05
#define OUTBD_TANK_LEVEL_ALARM_SRQ       APPLIC_SRQ_BASE | 0x06
#define INBD_TANK_LEVEL_ALARM_SRQ        APPLIC_SRQ_BASE | 0x07

#endif







