altos: Make sure pa to altitude conversion is done with 32 bits
[fw/altos] / src / core / ao_serial.h
1 /*
2  * Copyright © 2012 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
16  */
17
18 #ifndef _AO_SERIAL_H_
19 #define _AO_SERIAL_H_
20
21 #define AO_SERIAL_SPEED_4800    0
22 #define AO_SERIAL_SPEED_9600    1
23 #define AO_SERIAL_SPEED_19200   2
24 #define AO_SERIAL_SPEED_57600   3
25
26 #if HAS_SERIAL_0
27 extern volatile __xdata struct ao_fifo  ao_serial0_rx_fifo;
28 extern volatile __xdata struct ao_fifo  ao_serial0_tx_fifo;
29
30 char
31 ao_serial0_getchar(void);
32
33 void
34 ao_serial0_putchar(char c);
35
36 void
37 ao_serial0_drain(void);
38
39 void
40 ao_serial0_set_speed(uint8_t speed);
41 #endif
42
43 #if HAS_SERIAL_1
44 extern volatile __xdata struct ao_fifo  ao_serial1_rx_fifo;
45 extern volatile __xdata struct ao_fifo  ao_serial1_tx_fifo;
46
47 char
48 ao_serial1_getchar(void);
49
50 char
51 ao_serial1_pollchar(void);
52
53 void
54 ao_serial1_putchar(char c);
55
56 void
57 ao_serial1_drain(void);
58
59 void
60 ao_serial1_set_speed(uint8_t speed);
61 #endif
62
63 #if HAS_SERIAL_2
64 extern volatile __xdata struct ao_fifo  ao_serial2_rx_fifo;
65 extern volatile __xdata struct ao_fifo  ao_serial2_tx_fifo;
66
67 char
68 ao_serial2_getchar(void);
69
70 char
71 ao_serial2_pollchar(void);
72
73 void
74 ao_serial2_putchar(char c);
75
76 void
77 ao_serial2_drain(void);
78
79 void
80 ao_serial2_set_speed(uint8_t speed);
81 #endif
82
83 void
84 ao_serial_init(void);
85
86 #endif /* _AO_SERIAL_H_ */