home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
c_news
/
05
/
listings
/
f_baud.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-03-03
|
1KB
|
56 lines
/************************************************************************/
/* */
/* F_BAUD.C */
/* Level 1 FOSSIL function */
/* */
/************************************************************************/
/* */
/* FOSSIL Library Routine */
/* */
/************************************************************************/
/* REVISION 5 FOSSIL INTERFACE SPECIFICATIONS */
/************************************************************************/
#include "fossil.h"
int
f_baud(port,rate)
int port;
unsigned int rate;
{
int c;
switch (rate) {
case (300):
c = 0x40;
break;
case (600):
c = 0x60;
break;
case (1200):
c = 0x80;
break;
case (2400):
c = 0xa0;
break;
case (4800):
c = 0xc0;
break;
case (9600):
c = 0xe0;
break;
case (19200):
c = 0x00;
break;
case (38400):
c = 0x20;
break;
default:
return(1);
}
c |= 3;
return(f_setbaud(port,c));
}