source: rtems/c/src/libchip/serial/termios_baud2num.c @ 849dc107

4.104.114.84.9
Last change on this file since 849dc107 was 61ff7ac8, checked in by Joel Sherrill <joel.sherrill@…>, on Jul 9, 1998 at 11:29:33 PM

Added new baud rate to number function and default serial probe routine.

Renamed sersupp.c so we could have one routine per file to decrease
the baggage pulled into an application by default.

  • Property mode set to 100644
File size: 1.0 KB
Line 
1/*
2 *  $Id$
3 */
4
5#include <sys/termios.h>
6
7int termios_baud_to_number(
8  int termios_baud
9)
10{
11  int baud;
12
13  switch (termios_baud) {
14    case B0:        baud =      0;  break;
15    case B50:       baud =     50;  break;
16    case B75:       baud =     75;  break;
17    case B110:      baud =    110;  break;
18    case B134:      baud =    135;  break;
19    case B150:      baud =    150;  break;
20    case B200:      baud =    200;  break;
21    case B300:      baud =    300;  break;
22    case B600:      baud =    600;  break;
23    case B1200:     baud =   1200;  break;
24    case B1800:     baud =   1800;  break;
25    case B2400:     baud =   2400;  break;
26    case B4800:     baud =   4800;  break;
27    case B9600:     baud =   9600;  break;
28    case B19200:    baud =  19200;  break;
29    case B38400:    baud =  38400;  break;
30    case B57600:    baud =  57600;  break;
31    case B115200:   baud = 115200;  break;
32    case B230400:   baud = 230400;  break;
33    case B460800:   baud = 460800;  break;
34    default:        baud =     -1;  break;
35  }
36
37  return baud;
38}
39
Note: See TracBrowser for help on using the repository browser.