EasyManua.ls Logo

Intel 386

Intel 386
691 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Intel386™ EX EMBEDDED MICROPROCESSOR USERS MANUAL
11-38
SerialWriteChar:
Description:
Is a Polled serial port write function that waits forever or
until a character has been written to the serial port.
Parameters:
Unit Unit number of the serial port. 0 for SIO port 0,
1 for SIO port 1.
ch Character value to be written out
Returns:
None
Assumptions:
REMAPCFG register has Expanded I/O space access enabled (ESE bit set).
The processor Port pin are initialized separately.
Syntax:
#define SIO_0 0
char Char_Out = ‘a’;
SerialWriteChar (SIO_0, Char_Out);
Real/Protected Mode
No changes required.
*****************************************************************************/
void SerialWriteChar(int Unit, BYTE ch)
{
WORD TransmitPortAddr;
WORD StatusPortAddr;
/* Set Port base, based on serial port used */
TransmitPortAddr = (Unit ? TBR1 : TBR0);
StatusPortAddr = (Unit ? LSR1 : LSR0);
/* Wait until buffer is empty */
while(!(_GetEXRegByte(StatusPortAddr) & SIO_TX_BUF_EMPTY)) ;
_SetEXRegByte(TransmitPortAddr,ch);
}/* SerialWriteChar */
/*****************************************************************************
SerialWriteStr:

Table of Contents

Related product manuals