Intel 386 Computer Hardware User Manual


 
Intel386™ EX EMBEDDED MICROPROCESSOR USER’S MANUAL
11-34
options
ModemCntrl Defines the operation of the modem control lines
BaudRate Specifies baud rate. The baud divisor value is calculated
based on clocking source and clock frequency. The
clocking frequency is set by calling the
InitializeLibrary function.
ClockRate Specifies the serial port clocking rate, for internal
clocking = CLK2, for external = COMCLK
Returns:Error Codes
E_INVAILD_DEVICE -- Unit number specifies a non-existing device
E_OK -- Initialized OK, No error.
Assumptions:
SIOCFG Has already been configured for Clocking source and Modem
control source
REMAPCFG register has Expanded I/O space access enabled (ESE bit set).
The processor Port pin are initialized separately.
Syntax:
#define SIO_0 0x0
#define SIO_8N1 (SIO_8DATA | SIO_1STOPBIT | SIO_NOPARITY)
#define SIO_MCR_RTS 0x2
#define SIO_MCR_DTR 0x1
#define SIO_8DATA 0x3
#define SIO_1STOPBIT 0x0
//Clock rate of COMCLK, i.e., External clocking
#define BAUD_CLKIN 1843200L
int error;
error = InitSIO(SIO_0, // Which Serial Port
SIO_8N1, // Mode, 8-data, no parity, 1-stop
SIO_MCR_RTS+SIO_MCR_DTR, // Modem line controls
9600, // Baud Rate
BAUD_CLKIN); // Baud Clocking Rate
Real/Protected Mode:
No changes required.
*****************************************************************************/
int InitSIO(int Unit, BYTE Mode, BYTE ModemCntrl, DWORD BaudRate,
DWORD BaudClkIn)
{
WORD SIOPortBase;
WORD BaudDivisor;
/* Check for valid unit */
if(Unit > 1)