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; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 #define AO_SERIAL_SPEED_4800 0
23 #define AO_SERIAL_SPEED_9600 1
24 #define AO_SERIAL_SPEED_19200 2
25 #define AO_SERIAL_SPEED_57600 3
26 #define AO_SERIAL_SPEED_115200 4
29 extern volatile struct ao_fifo ao_serial0_rx_fifo;
30 extern volatile struct ao_fifo ao_serial0_tx_fifo;
33 ao_serial0_getchar(void);
36 _ao_serial0_pollchar(void);
39 _ao_serial0_sleep_for(AO_TICK_TYPE timeout);
42 ao_serial0_putchar(char c);
45 ao_serial0_drain(void);
48 ao_serial0_set_speed(uint8_t speed);
52 extern volatile struct ao_fifo ao_serial1_rx_fifo;
53 extern volatile struct ao_fifo ao_serial1_tx_fifo;
56 ao_serial1_getchar(void);
59 _ao_serial1_pollchar(void);
62 _ao_serial1_sleep_for(AO_TICK_TYPE timeout);
65 ao_serial1_putchar(char c);
68 ao_serial1_drain(void);
71 ao_serial1_set_speed(uint8_t speed);
75 extern volatile struct ao_fifo ao_serial2_rx_fifo;
76 extern volatile struct ao_fifo ao_serial2_tx_fifo;
79 ao_serial2_getchar(void);
82 _ao_serial2_pollchar(void);
85 _ao_serial2_sleep_for(AO_TICK_TYPE timeout);
88 ao_serial2_putchar(char c);
91 ao_serial2_drain(void);
94 ao_serial2_set_speed(uint8_t speed);
98 extern volatile struct ao_fifo ao_serial3_rx_fifo;
99 extern volatile struct ao_fifo ao_serial3_tx_fifo;
102 ao_serial3_getchar(void);
105 _ao_serial3_pollchar(void);
108 _ao_serial3_sleep_for(AO_TICK_TYPE timeout);
111 ao_serial3_putchar(char c);
114 ao_serial3_drain(void);
117 ao_serial3_set_speed(uint8_t speed);
121 ao_serial_shutdown(void);
124 ao_serial_init(void);
126 #endif /* _AO_SERIAL_H_ */