/*******************************************************************/ /* Advanced Communication Board Developer Toolkit 1993 */ /* For use with Advanced Communication Boards */ /* ACB.C */ /* This file defines routines that interface to the 85x30 SCC */ /* chips. */ /* Source file is ACB.C */ /* .OBJ File Linked to Program for ACB use */ /*******************************************************************/ #include #include #include #include #include #include #include "acb.h" #ifdef _BORLAND #define IN inport #define OUT outport #define FAR far #define ASMBLOCKSTART #define ASMBLOCKEND #define ASMLINE asm #else #define IN _inp #define OUT _outp #define FAR _far #define ASMBLOCKSTART _asm{ #define ASMBLOCKEND } #define ASMLINE #endif /******************************************************************* Prototypes *******************************************************************/ void IOPause (void); /******************************************************************* IOPause : Add software recovery time *******************************************************************/ void IOPause(void) { ASMBLOCKSTART ASMLINE jmp short $+2 ASMLINE jmp short $+2 ASMLINE jmp short $+2 ASMLINE jmp short $+2 ASMLINE jmp short $+2 ASMLINE jmp short $+2 ASMLINE jmp short $+2 ASMLINE jmp short $+2 ASMLINE jmp short $+2 ASMBLOCKEND } /******************************************************************* SCCin : SCCin routine *******************************************************************/ unsigned char SCCin(unsigned short wIOAddress, unsigned char bReg) { unsigned char bTemp; OUT((wIOAddress + 1), bReg); IOPause(); bTemp = IN( (wIOAddress+1) ); IOPause(); return(bTemp); } /******************************************************************* SCCout : This writes to the Z8530 SCCout routine *******************************************************************/ void SCCout(unsigned short wIOAddress, unsigned char bReg,unsigned char bValue) { OUT((wIOAddress+1), bReg); IOPause(); OUT((wIOAddress+1), bValue); IOPause(); } /******************************************************************* SCCInit : SCCInit routine This routine will initialize the SCC 8530 *******************************************************************/ void SCCInitEx(unsigned short wBase, unsigned char FAR * init, unsigned short wLength) { int i; for (i=0; i