13-29
SYNCHRONOUS SERIAL I/O UNIT
/* Disable Receiver */
_SetEXRegByte(SSIOCON1, SSControl);
}
else { // Slave Receiver, Receiver MUST already be Enabled
/* Wait until Receive Holding Buffer is Full */
while(!(_GetEXRegByte(SSIOCON1) & SSIO_RHBF) );
}
return (WORD)_GetEXRegWord(SSIORBUF);
}/* SSerialReadWord */
/*****************************************************************************
SSerialWriteWord:
Description:
Is a Polled serial port write function that will wait forever
or until a character has been written to the serial port.
Parameters:
Ch Word to be written out to serial port
MasterSlave Defines whether transmitter is Master or Slave
Returns:
None
Assumptions:
If transmitter is in Slave mode, it must already be enabled.
Syntax:
#define SSIO_TX_MASTR 0x2
#define SSIO_TX_SLAVE 0x0
char Ch = ‘a’;
SSerialWriteWord( (WORD)Ch, SSIO_TX_MASTR );
Real/Protected Mode:
No changes required.
******************************************************************************/
void SSerialWriteWord(WORD Ch,BYTE MasterSlave)
{
register BYTE SSControl;
unsigned int i;
if(MasterSlave == SSIO_TX_MASTR)
{
/* Save Control Register */
SSControl = _GetEXRegByte(SSIOCON1);