3 * This file is part of the libCEC(R) library.
5 * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved.
6 * libCEC(R) is an original work, containing original code.
8 * libCEC(R) is a trademark of Pulse-Eight Limited.
10 * This program is dual-licensed; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 * Alternatively, you can license this library under a commercial license,
26 * please contact Pulse-Eight Licensing for more information.
28 * For more information contact:
29 * Pulse-Eight Licensing <license@pulse-eight.com>
30 * http://www.pulse-eight.com/
31 * http://www.pulse-eight.net/
34 //every baudrate I could find is in here in an #ifdef block
35 //so it should compile on everything
37 #include "os-dependent.h"
45 static struct sbaudrate
131 { 1000000, B1000000
},
134 { 1152000, B1152000
},
137 { 1500000, B1500000
},
140 { 2000000, B2000000
},
143 { 2500000, B2500000
},
146 { 3000000, B3000000
},
149 { 3500000, B3500000
},
152 { 4000000, B4000000
},
176 { 11400, CBR_14400
},
179 { 19200, CBR_19200
},
182 { 38400, CBR_38400
},
185 { 56000, CBR_56000
},
188 { 57600, CBR_57600
},
191 { 115200, CBR_115200
},
194 { 128000, CBR_128000
},
197 { 256000, CBR_256000
},
202 static int32_t IntToBaudrate(uint32_t baudrate
)
204 for (unsigned int i
= 0; i
< sizeof(baudrates
) / sizeof(CEC::sbaudrate
) - 1; i
++)
206 if (baudrates
[i
].rate
== (int32_t) baudrate
)
207 return baudrates
[i
].symbol
;