Intel 386 User Manual

Page 332

Advertising
background image

11-45

ASYNCHRONOUS SERIAL I/O UNIT

None

Assumptions:

None

Syntax:

Not called by user.

Real/Protected Mode:

No changes required.

******************************************************************************/

void Service_TBE(void)

{

if (trans_buffer[Tbuffer_index] != ‘\0’) {

_SetEXRegByte(TBR0, trans_buffer[Tbuffer_index]);

Tbuffer_index++;

}

else {

/* Disable TBE interrupts */

_SetEXRegByte(IER0, 0x00);

}

}/* Service_TBE */

/****************************************************************************

Example code to show how to set up for a Serial Port interrupt.

This example is for an interrupt on SIO_0 sourced by the

Receive Buffer Full Signal. The source code for the functions “SetIRQVector”

and “Disable8259Interrupt” is included in the Interrupt Control Unit chapter.

SetIRQVector(Serial0_ISR, 4, INTERRUPT_ISR); // Set vector for Interrupt

// on Master line 4

Disable8259Interrupt(IR1+IR5+IR6+IR7, IR0+IR1+IR2+IR3+IR4+IR5+IR6+IR7);

Enable8259Interrupt(IR2+IR4,0);// Enable slave interrupt to master(IR2),

// Enable SIO_0 (IR4)

_enable(); // Enable Interrupts

_SetEXRegByte(IER0, 0x01);

// Enable interrupt on RBF signal

/****************************************************************************/

Advertising