Silicon Laboratories SI2493/57/34/15/04, SI2494/39 manual 302

Models: SI2493/57/34/15/04 SI2494/39

1 304
Download 304 pages 21.65 Kb
Page 302
Image 302

AN93

//Insert code here to inform the host of the U70 interrupt

//or service it application dependent), e.g. gU70Interrupt = 1;

}

//***TXE INTERRUPT*** if ( TXEInterrupt )

{

//Clear the data sent counter BytesSent = 0;

//The transmit FIFO is fourteen bytes deep, therefore upon TXE interrupts

//(two bytes or fewer in the transmit FIFO), it is possible to send up to

//twelve bytes to the part without risking overflow.

while ( ( gUARTToModemBufferSize > 0 ) && ( BytesSent < 12 ) )

{

writeModem( HIR0, pullByteForModem(), 0xFF ); BytesSent++;

}

//If there weren't enough data sent to clear the interrupt, clear it manually. if ( BytesSent < 3 )

{

//Clear the TXE bit to clear the interrupt ClearTXE;

control_update = 1;

}

}

//Check if the status register needs to be written if ( control_update )

{

writeModem( HIR1, modem_control, 0xFF ); control_update = 0;

}

//Read register 1 to get current status ReadModemStatus;

//Reset receiver counter for a subsequent RXF condition in this loop BytesReceived = 0;

}

 

 

SFRPAGE = SFRPAGE_SAVE;

//

Restore SFR page

EA = 1;

//

Enable global interrupt

}

302

Rev. 1.3

Page 302
Image 302
Silicon Laboratories SI2493/57/34/15/04, SI2494/39 manual 302