
CD2481
—
Programmable Four-Channel Communications Controller
110
Datasheet
8.5
Transmit Interrupt Service Routine
The following example is a transmit interrupt service handler example. When using a synchronous
protocol, transmitters must declare an end of frame if an underrun occurs. If the end of buffer is
encountered before data is transferred by this interrupt service, then the NOTRANS bit in TEOIR
should be set along with EOF. TEOIR is always the last access of an interrupt service routine.
int teoir = ZERO;// default
int tisr = inportb( TISR );// status
int ch = inportb( TIR ) & 0x03;// channel number
switch( tisr ) {
case TISR_UE:
teoir = TEOIR_EOF;// underflow
break;
case TISR_TXDATA:
tftc = inportb( TFTC ); // FIFO count
for( i=0; i<tftc; i++) {
if( ob[ch].is_eob() ) {// end of buffer
ob[ch].nxt_buf();// get next buffer
teoir = TEOIR_EOF;
if( i==0 )
teoir |= NOTRANS;
break;
}
else outportb( TDR, ob[ch].nxt_char() );//send next character
}
}
outportb( TEOIR, teoir );
8.6
Support Files from the Intel FTP Server
For additional programming examples, sample register definition and symbol header files (for
C++), connect to the Basis Communications ftp server and download the files in the datacom
support area:
ftp://ftp.basiscomm.com/pub/oem/sio/cd2481/evalbdv2