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.
24 * Packet-based command interface
27 #define AO_PACKET_MAX 64
28 #define AO_PACKET_SYN (uint8_t) 0xff
35 uint8_t d[AO_PACKET_MAX];
36 uint8_t callsign[AO_MAX_CALLSIGN];
39 struct ao_packet_recv {
40 struct ao_packet packet;
45 extern __xdata struct ao_packet_recv ao_rx_packet;
46 extern __xdata struct ao_packet ao_tx_packet;
47 extern __xdata struct ao_task ao_packet_task;
48 extern __xdata uint8_t ao_packet_enable;
49 extern __xdata uint8_t ao_packet_master_sleeping;
50 extern __pdata uint8_t ao_packet_rx_len, ao_packet_rx_used, ao_packet_tx_used;
51 extern __xdata uint8_t ao_packet_restart;
60 ao_packet_flush(void);
63 ao_packet_putchar(char c) __reentrant;
66 _ao_packet_pollchar(void);
69 /* ao_packet_master.c */
71 extern __xdata uint8_t ao_packet_last_rssi;
74 ao_packet_master_init(void);
78 /* ao_packet_slave.c */
81 ao_packet_slave_start(void);
84 ao_packet_slave_stop(void);
87 ao_packet_slave_init(uint8_t enable);
91 #endif /* _AO_PACKET_H_ */