7-19
SYSTEM MANAGEMENT MODE
_SetEXRegByte(SIOPortBase + DLH, HIBYTE(BaudDivisor) );
_SetEXRegByte(SIOPortBase + DLL, LOBYTE(BaudDivisor) );
// Set Serial Line control register
_SetEXRegByte(SIOPortBase + LCR, Mode); // Sets Mode and resets the
// Divisor latch
// Set modem control bits
_SetEXRegByte(SIOPortBase + MCR, ModemCntrl);
return E_OK;
}
/******************************* MAIN ***********************************/
Parameters:
None
Returns:
None
Assumptions:
None
Real/Protected Mode
No changes required.
--------------------------------------------------------------------------*/
#ifndef SetEXRegWordInline
#define SetEXRegWordInline(address, word) \
_asm mov dx, address; \
_asm mov ax, word; \
_asm out dx, ax;
#endif
void main(void)
{
InitSIO(SIO_PORT, // 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
_asm // Store registers to preserve values
{
push DI
push SI
push DS
push ES
}
SetEXRegWordInline(CS4ADL, 0x702); // Configure chip select 4
SetEXRegWordInline(CS4ADH, 0x0);
SetEXRegWordInline(CS4MSKL, 0xFC01);
SetEXRegWordInline(CS4MSKH, 0x0);