OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [libchip/] [serial/] [termios_baud2num.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  $Id: termios_baud2num.c,v 1.2 2001-09-27 12:01:42 chris Exp $
3
 */
4
 
5
#include <sys/termios.h>
6
 
7
int 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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.