Intel 386 User Manual page 322

Embedded microprocessor
Table of Contents

Advertisement

return E_INVALID_DEVICE;
/* Set Port base based on serial port used */
SIOPortBase = (Unit ? SIO1_BASE : SIO0_BASE);
/* Initialized Serial Port registers */
/* Calculate the baud divisor value, based on baud clocking */
BaudDivisor = (WORD)(BaudClkIn / (16*BaudRate));
/* Turn on access to baud divisor register */
_SetEXRegByte(SIOPortBase + LCR, 0x80);
/* Set the baud rate divisor register, High byte first */
_SetEXRegByte(SIOPortBase + DLH, HIBYTE(BaudDivisor) );
_SetEXRegByte(SIOPortBase + DLL, LOBYTE(BaudDivisor) );
/*** Set Serial Line control register ***/
_SetEXRegByte(SIOPortBase + LCR, Mode);// Sets Mode and
/* Set modem control bits */
_SetEXRegByte(SIOPortBase + MCR, ModemCntrl);
return E_OK;
}/* InitSIO */
/*****************************************************************************
SerialReadStr
Description:
Is a Polled serial port read function that waits forever or until
count characters are read from the serial port.
Parameters:
Unit
str
count
Returns: Error Code
E_OK or Error code status (value of Line Status Register (LSR)
Assumptions:
REMAPCFG register has Expanded I/O space access enabled (ESE bit set).
The processor Port pin are initialized separately.
Syntax:
//reset the Divisor latch
Unit number of the serial port. 0 for SIO port 0,
1 for SIO port 1.
Address of where to place the input data
Number of characters to read before returning.
ASYNCHRONOUS SERIAL I/O UNIT
11-35

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Intel386 exIntel386 extbIntel386 extc

Table of Contents