C-9
EXAMPLE CODE HEADER FILES
#define SIO_TX_EMPTY 0x40
/* Offsets from beginning of SIO port addresses */
#define RBR 0
#define TBR 0
#define DLL 0
#define IER 1
#define DLH 1
#define IIR 2
#define LCR 3
#define MCR 4
#define LSR 5
#define MSR 6
#define SCR 7
#define SIO0_BASE 0xF4F8
#define SIO1_BASE 0xF8F8
/* Define Function Macros */
#define GetSIO0Status() _GetEXRegByte(LSR0)
#define GetSIO1Status() _GetEXRegByte(LSR1)
#define GetSIO0InterruptID() _GetEXRegByte(IIR0)
#define GetSIO1InterruptID() _GetEXRegByte(IIR1)
#define GetSIO0ModemStatus() _GetEXRegByte(MSR0)
#define GetSIO1ModemStatus() _GetEXRegByte(MSR1)
#define GetSIO0Char() _GetEXRegByte(RBR0)
#define GetSIO1Char() _GetEXRegByte(RBR1)
#define ChangeSIO0IntrSrc(src) _SetEXRegByte(IER0,src)
#define ChangeSIO1IntrSrc(src) _SetEXRegByte(IER1,src)
#define ChangeSIO0Mode(Mode) _SetEXRegByte(LCR0,Mode)
#define ChangeSIO1Mode(Mode) _SetEXRegByte(LCR1,Mode)
#define DisableSIO0Interrupt(src) _SetEXRegByte(IER0,_GetEXRegByte(IER0) &
!(src))
#define DisableSIO1Interrupt(src) _SetEXRegByte(IER1,_GetEXRegByte(IER1) &
!(src))
/* SIO Function Definitions */
extern int InitSIO (int Unit, BYTE Mode, BYTE ModemCntrl, DWORD BaudRate,
DWORD BaudClkIn);
extern BYTE SerialReadChar(int Unit);
extern int SerialReadStr(int Unit, char far *str, int count);
extern void SerialWriteChar(int Unit, BYTE ch);
extern void SerialWriteStr(int Unit, const char far *str);
extern void SerialWriteMem(int Unit, const char far *mem, int count);
void interrupt far Serial0_ISR(void);
extern void Service_RBF (void);
extern void SerialWriteStr_Int(int Unit, const char far *str);
extern void Service_TBE(void);
/***************** DMA configuration defines *****************/