/****************************************************************************/
/* Copyright 1996 MBARI                                                     */
/****************************************************************************/
/* Summary  : IBC Hydrophone Power Supply Board Definitions                 */
/* Filename : hydroPSU.h                                                    */
/* Author   : Andrew Pearce                                                 */
/* Project  : Tibuton ROV Data Concentrator                                 */
/* Version  : 1.0                                                           */
/* Created  : 06/09/96                                                      */
/* Modified : 06/09/96                                                      */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/* $Header: /usr/tiburon/.cvsroot/micro/h/hydropsu.h,v 1.1.1.1 1997/05/02 17:15:38 pean Exp $
 * $Log: hydropsu.h,v $
 * Revision 1.1.1.1  1997/05/02 17:15:38  pean
 * Initial release of the microcontroller software after Tiburon
 * Moolpool Dive to test IView, Lapboxes, modified Power can
 * GF/5V using bus capacitance mode.
 *
*/
/****************************************************************************/

                                /* Hydrophone Power Supply Register Offsets */
#define HYDRO_PSU_COMMAND_REG   0x00  /* Command Register                   */
#define HYDRO_PSU_STATUS_REG    0x00  /* Status Register                    */

                                /* Hydrophone PSU Command Register Bits     */
#define HYDRO_PSU_SWITCH_ON     0x01  /* Switch Power Supply ON Command     */
#define HYDRO_PSU_SWITCH_OFF    0x00  /* Switch Power Supply OFF Command    */
#define HYDRO_PSU_LED_ON        0x40  /* Switch on-board LED ON Command     */
#define HYDRO_PSU_LED_OFF       0x00  /* Switch on-board LED OFF Command    */

                                /* Hydrophone PSU Status Register Bits      */
#define HYDRO_PSU_FAILED        0x01  /* PSU Failed Bit                     */

typedef struct                  /* Hydrophone PSU Switch Data Structure     */
{
    IBC_BoardEntry IBC_Board;           /* IBC Board Entry structure        */

    MBool switchState;                  /* Software copy of switch state    */
    Int16 psuStatus;                    /* PSU Faults Status                */
} hydroPSU_BoardEntry;

#ifdef __STDC__

Int16 hydroPSU_BoardSearch( IBC_BoardEntry *IBC_Boards[], Int16 maxCards );

                           /* Hydrophone PSU Board Initialization Routine   */
hydroPSU_BoardEntry* hydroPSU_BoardInit( Byte *boardBaseAddr );

Int16 hydroPSU_BoardSwitch( hydroPSU_BoardEntry *hydroPSU_Board, Boolean state);

Int16 hydroPSU_BoardSwitchState( hydroPSU_BoardEntry *hydroPSU_Board );

Void hydroPSU_SwitchControlCmd( IBC_BoardEntry* IBC_CardTable[],
    Int16 IBC_CardCount, Byte *commandBuf );

Void hydroPSU_GetPSUStateCmd( IBC_BoardEntry* IBC_CardTable[],
    Int16 IBC_CardCount, Byte *commandBuf );

Void hydroPSU_GetFaultCmd( IBC_BoardEntry* IBC_CardTable[],
    Int16 IBC_CardCount, Byte *commandBuf );

Void hydroPSUFunctions( hydroPSU_BoardEntry *hydroPSU_Board );

#endif

