English
Language : 

CD1284 Datasheet, PDF (96/176 Pages) Intel Corporation – IEEE 1284-Compatible Parallel Interface Controller with Two High-Speed Asynchronous Serial Ports
CD1284 — IEEE 1284-Compatible Parallel Interface Controller
6.3.1.3
6.3.1.4
each
/* Code here would put the character in a buffer of some sort for
* channel. That code would be dependent on system software design
* so it won’t be shown here. */
sequence */
status */
sequence */
}
}
}
outportb(RIR, save_rir & 0x3f);/* terminate service ack.
outportb(CAR, save_car); /* restore original CAR* /
return(0);
break;
case 7:
/* exception data service request */
status = inportb(RDSR);/* by definition, only one char; get
outportb(RIR, save_rir & 0x3f);/* terminate service ack.
outportb(CAR, save_car); /* restore original CAR */
return(status);
/* just return the error type */
break;
Serial Transmit Service
/* The transmit service acknowledge routine follows very nearly the same steps that
the receive service routine follows. This time, the TIR is used to force the switch
to a transmit service for the requesting channel. */
service_txm( )
{
char
int
save_tir, save_car, channel;
char_count, i;
save_tir = inportb(TIR);
value */
channel = save_tir & 0x03;
save_car = inportb(CAR);
outportb(CAR, save_tir);
*/
/* retrieve and save transmit interrupt
/* extract channel number from the TIR*/
/* save CAR for restore */
/* switch CD1284 to service ack. context
/* Buffer management code would set-up pointers to the next 12
* characters (maximum) to be sent on this channel. Again, buffer
* layout is system design dependent and won’t be shown here.
*/
for ( i = 0; i < char_count; i++) {/* transmit FIFO can take 12 characters
*/
outportb(TDR, *next_char++);
/* it is assumed that char_count and next_char is set up by buffer code
*/
}
outportb(TIR, save_tir & 0x3f);/* terminate service ack. sequence */
outportb(CAR, save_car); /* restore original CAR */
return(0);
}
Modem Service
/* Code to handle modem signal change service request can be simple or complex
depending on whether port control is handled directly in the service routine or
simply noted with status returned. The following routine services the request and
returns the status of which signals changed with the channel number OR’ed into the
96
Datasheet