/****************************************************************************/
/* Copyright 1993 to 1996 MBARI                                             */
/****************************************************************************/
/* Summary  : Power Can Data Concentrator - Defininitions and Constants     */
/* Filename : pwr_ibc.h                                                     */
/* Author   : Andrew Pearce                                                 */
/* Project  : Tiburon DC Power IBC Data Concentrator                        */
/* Version  : 1.0                                                           */
/* Created  : 06/11/93                                                      */
/* Modified : 02/16/96                                                      */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/* $Header: /usr/tiburon/.cvsroot/micro/h/pwr_ibc.h,v 1.1.1.1 1997/05/02 17:15:40 pean Exp $
 * $Log: pwr_ibc.h,v $
 * Revision 1.1.1.1  1997/05/02 17:15:40  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.6  97/04/28  11:00:40  11:00:40  pean (Andrew Pearce)
 * GF/5V board bus capacitance model added
 *
 * Revision 1.5  96/08/07  15:30:48  15:30:48  pean (Andrew Pearce)
 * Fixed problem with GF scanning stopping when RESTART_SCAN command sent
 *
 * Revision 1.4  96/07/02  15:16:44  15:16:44  pean (Andrew Pearce)
 * Power IBC B: Vehicle Running Light switched on at power up
 *
 * Revision 1.3  96/02/16  09:30:33  09:30:33  pean (Andrew Pearce)
 * Revised GF/5V Selftest, scan update features
 * Fixed timer_cancel library function
 * Revised Quad Serial Board Overrun Error reporting
 *
 * Revision 1.2  93/08/06  11:45:48  11:45:48  pean (Andrew Pearce)
 * GF Selftest moved from GF_BoardInit (at power up) to GF_Enable command
 * Therefore, added GF_SELFTEST_STATUS_SRQ to report result
 *
 * Revision 1.1  93/07/02  09:38:34  09:38:34  pean (Andrew Pearce)
 * Initial revision
 *
 *
*/
/****************************************************************************/

                                        /* Power IBC A/D Channel Assignments*/
#define HUMIDITY_SENSOR_CHAN   0        /* Humidity Sensor A to D Channel   */
#define FAN_SPEED_CHAN         1        /* Fan Speed A to D Channel         */
#define WATER_ALARM_CHAN       2        /* Water Alarm Analog Channel       */
#define SPARE_ATOD_CHAN        3        /* Spare Analog Channel             */

#define WATER_ALARM_BIT  0x01           /* 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          */

                                        /* Voltage(V) = A/D * 5.0V / 1024   */
#define FAN_SPEED_VOLTS(bits)  ( ( ((Nat16) bits) * 50) / 1024)

                                        /* ** Power 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_FAN_SPEED          0x04     /* Get Housing Fan Speed Voltage    */


