22 PCL-740 User's Manual
/* Set up Port 2 (COM2) */
outport((base1+2),0xc9); /* Enable FIFO */
outp(base1+3,0x80); /* Set DLAB=1 */
/* Set bps = 115,200 */
outp(base1 ,0x01); outp(base1+1,0);
outp(base1+3,0x03); /* Set data=8; stop=1; no parity*/
outp(base1+1,0x00); /* Disable interrupt */
printf("\nEnter string (max 15 char) or Q to quit:");
gets(cmd);
while (cmd[0] != ‘q’ && cmd[0] != ‘Q’)
{
/* Send string on Port 1 (COM1) */
i=0;
cmd[strlen(cmd)] = 0x0d;
flag=1;
while (flag)
{
outportb(base0,cmd[i]); /* Send data */
if (cmd[i] == 0x0d)
flag=0;
i++;
}
Komentáře k této Příručce