2 * Copyright © 2012 Keith Packard <keithp@keithp.com>
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.
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.
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.
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 #define AO_SERIAL_SPEED_115200 4
28 extern volatile __xdata struct ao_fifo ao_serial0_rx_fifo;
29 extern volatile __xdata struct ao_fifo ao_serial0_tx_fifo;
32 ao_serial0_getchar(void);
35 _ao_serial0_pollchar(void);
38 _ao_serial0_sleep(void);
41 ao_serial0_putchar(char c);
44 ao_serial0_drain(void);
47 ao_serial0_set_speed(uint8_t speed);
51 extern volatile __xdata struct ao_fifo ao_serial1_rx_fifo;
52 extern volatile __xdata struct ao_fifo ao_serial1_tx_fifo;
55 ao_serial1_getchar(void);
58 _ao_serial1_pollchar(void);
61 _ao_serial1_sleep(void);
64 ao_serial1_putchar(char c);
67 ao_serial1_drain(void);
70 ao_serial1_set_speed(uint8_t speed);
74 extern volatile __xdata struct ao_fifo ao_serial2_rx_fifo;
75 extern volatile __xdata struct ao_fifo ao_serial2_tx_fifo;
78 ao_serial2_getchar(void);
81 _ao_serial2_pollchar(void);
84 _ao_serial2_sleep(void);
87 ao_serial2_putchar(char c);
90 ao_serial2_drain(void);
93 ao_serial2_set_speed(uint8_t speed);
97 extern volatile __xdata struct ao_fifo ao_serial3_rx_fifo;
98 extern volatile __xdata struct ao_fifo ao_serial3_tx_fifo;
101 ao_serial3_getchar(void);
104 _ao_serial3_pollchar(void);
107 _ao_serial3_sleep(void);
110 ao_serial3_putchar(char c);
113 ao_serial3_drain(void);
116 ao_serial3_set_speed(uint8_t speed);
120 ao_serial_init(void);
122 #endif /* _AO_SERIAL_H_ */