3 * This file is part of the libCEC(R) library.
5 * libCEC(R) is Copyright (C) 2011-2012 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
43 static struct sbaudrate
130 { 1000000, B1000000
},
133 { 1152000, B1152000
},
136 { 1500000, B1500000
},
139 { 2000000, B2000000
},
142 { 2500000, B2500000
},
145 { 3000000, B3000000
},
148 { 3500000, B3500000
},
151 { 4000000, B4000000
},
175 { 11400, CBR_14400
},
178 { 19200, CBR_19200
},
181 { 38400, CBR_38400
},
184 { 56000, CBR_56000
},
187 { 57600, CBR_57600
},
190 { 115200, CBR_115200
},
193 { 128000, CBR_128000
},
196 { 256000, CBR_256000
},
201 inline int32_t IntToBaudrate(uint32_t baudrate
)
203 for (unsigned int i
= 0; i
< sizeof(baudrates
) / sizeof(PLATFORM::sbaudrate
) - 1; i
++)
205 if (baudrates
[i
].rate
== (int32_t) baudrate
)
206 return baudrates
[i
].symbol
;