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 struct ao_samd21_usart ao_samd21_usart0;
32 ao_serial0_getchar(void);
35 _ao_serial0_pollchar(void);
38 _ao_serial0_sleep_for(uint16_t timeout);
41 ao_serial0_putchar(char c);
44 ao_serial0_drain(void);
47 ao_serial0_set_speed(uint8_t speed);
51 extern struct ao_samd21_usart ao_samd21_usart1;
54 ao_serial1_getchar(void);
57 _ao_serial1_pollchar(void);
60 _ao_serial1_sleep_for(uint16_t timeout);
63 ao_serial1_putchar(char c);
66 ao_serial1_drain(void);
69 ao_serial1_set_speed(uint8_t speed);
73 extern struct ao_samd21_usart ao_samd21_usart2;
76 ao_serial2_getchar(void);
79 _ao_serial2_pollchar(void);
82 _ao_serial2_sleep_for(uint16_t timeout);
85 ao_serial2_putchar(char c);
88 ao_serial2_drain(void);
91 ao_serial2_set_speed(uint8_t speed);
95 extern struct ao_samd21_usart ao_samd21_usart3;
98 ao_serial3_getchar(void);
101 _ao_serial3_pollchar(void);
104 _ao_serial3_sleep_for(uint16_t timeout);
107 ao_serial3_putchar(char c);
110 ao_serial3_drain(void);
113 ao_serial3_set_speed(uint8_t speed);
117 extern struct ao_samd21_usart ao_samd21_usart4;
120 ao_serial4_getchar(void);
123 _ao_serial4_pollchar(void);
126 _ao_serial4_sleep_for(uint16_t timeout);
129 ao_serial4_putchar(char c);
132 ao_serial4_drain(void);
135 ao_serial4_set_speed(uint8_t speed);
139 extern struct ao_samd21_usart ao_samd21_usart5;
142 ao_serial5_getchar(void);
145 _ao_serial5_pollchar(void);
148 _ao_serial5_sleep_for(uint16_t timeout);
151 ao_serial5_putchar(char c);
154 ao_serial5_drain(void);
157 ao_serial5_set_speed(uint8_t speed);
161 ao_serial_init(void);
163 #endif /* _AO_SERIAL_H_ */