/******************************************************************************/
/* Copyright 1991 to 1993 MBARI                                               */
/******************************************************************************/
/* Summary  : General Micro Systems SIO32 Serial Board misc. definitions      */
/* Filename : sio32.h                                                         */
/* Author   : Andrew Pearce                                                   */
/* Project  : GMS Serial Board Driver for VxWorks                             */
/* Version  : Version 1.0                                                     */
/* Created  : 06/20/91                                                        */
/* Modified : 06/14/93                                                        */
/* Archived :                                                                 */
/******************************************************************************/

#define PS_GOOD_UART 2                  /* PS Good signals are connected to   */
#define PS_GOOD_CHAN 6                  /* UART #2, channel 7 of 7, but 6 & 7 */
                                        /* are accessed together, so use 6    */

#define SIO32_MAX_UARTS     3           /* Maximum number of uarts per card   */
#define SIO32_CHAN_PER_UART 8           /* Number of serial channels per UART */

                                        /* Number of serial channels per card */
#define PORTS_PER_SIO32  SIO32_MAX_UARTS * SIO32_CHAN_PER_UART

#define SIO32_UART1         (Char *) 0xFEFE1000     /* Octal UART 1 Address   */
#define SIO32_UART2         (Char *) 0xFEFE1100     /* Octal UART 2 Address   */
#define SIO32_UART3         (Char *) 0xFEFE1200     /* Octal UART 3 Address   */
#define SIO32_UART4         (Char *) 0xFEFE1300     /* Octal UART 4 Address   */
#define SIO32_VECT_REG      (Char *) 0xFEFE1400     /* Vector Register Address*/

#define SIO32_REG_OFFSET  0x04          /* UART registers are every 4 bytes   */
#define SIO32_CHAN_OFFSET 0x20          /* Each channel occupies 0x20 bytes   */

                                        /* Return UART's absolute base address*/
#define SIO32_UART_ADDR(uart) \
    ((Char *) (SIO32_UART1 + uart * SIO32_CHAN_OFFSET * SIO32_CHAN_PER_UART))

                                        /* Return register's absolute address */
                                        /* given uart #, channel # and reg ID */
#define SIO32_REG(uart, chan, reg) ((__volatile__ Char *) \
    (SIO32_UART_ADDR(uart) + (chan * SIO32_CHAN_OFFSET + \
    (reg * SIO32_REG_OFFSET))))


#ifdef INCLUDE_PROTOTYPES

#ifdef __STDC__

STATUS sio32BoardProbe(MBool sio32Debug);
Void sio32IntEnable(Nat16 sio32IntLevel);
Void sio32IntDisable(Nat16 sio32IntLevel);

#endif

#endif /* INCLUDE_PROTOTYPES */
