Intel386™ EX EMBEDDED MICROPROCESSOR USER'S MANUAL
options
ModemCntrl
BaudRate
ClockRate
Returns:Error Codes
E_INVAILD_DEVICE -- Unit number specifies a non-existing device
E_OK
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
#define SIO_8N1
#define SIO_MCR_RTS
#define SIO_MCR_DTR
#define SIO_8DATA
#define SIO_1STOPBIT 0x0
//Clock rate of COMCLK,
#define BAUD_CLKIN
int error;
error = InitSIO(SIO_0,
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)
11-34
Defines the operation of the modem control lines
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.
Specifies the serial port clocking rate, for internal
clocking = CLK2, for external = COMCLK
-- Initialized OK, No error.
0x0
(SIO_8DATA | SIO_1STOPBIT | SIO_NOPARITY)
0x2
0x1
0x3
i.e., External clocking
1843200L
SIO_8N1,
SIO_MCR_RTS+SIO_MCR_DTR, // Modem line controls
9600,
BAUD_CLKIN);
// Which Serial Port
// Mode, 8-data, no parity, 1-stop
// Baud Rate
// Baud Clocking Rate