2 * Copyright Droids Corporation (2010)
3 * Olivier Matz <zer0@droids-corp.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * Revision : $Id: main.c,v 1.8 2009-05-02 10:08:09 zer0 Exp $
24 #include <aversive/wait.h>
71 void uart_proto_init(void)
74 UCSRxB = _BV(RXENx) | _BV(TXENx);
75 UCSRxC = _BV(UCSZx1) | _BV(UCSZx0); /* 8 bits no parity 1 stop */
76 UBRRxL = 34; /* 57600 at 16 Mhz */
80 static void uart_proto_send(char c)
82 while ( !( UCSRxA & (1<<UDREx)) ) ;
86 int16_t uart_proto_recv(void)
88 if ( !(UCSRxA & (1<<RXCx)) )
93 /* transmit an integer between 0 and 16384 */
94 static void xmit_int14(uint16_t x)
108 void xmit_opp(uint16_t d, uint16_t a)
115 void xmit_static(uint16_t x, uint16_t y, uint16_t a)