Initial import of onewire-to-usb bridge
[onewire] / serial.h
1 /* 
2  * File:   serial.h
3  * Author: justin
4  *
5  * Created on 17 June 2013, 16:08
6  */
7
8 #ifndef SERIAL_H
9 #define SERIAL_H
10
11 extern char outbuff[];
12 char inbuff[];
13
14 void serial_init(void);
15
16 bool msg_empty(void);
17 void msg_write(const char *msg);
18 void msg_writebyte(const char msg);
19 void msg_sendnext(void);
20
21 void msg_recvnext(void);
22 bool msg_recvready(void);
23 char msg_recv(void);
24 void putch(char);
25
26 /* TODO Connect serial interupt handlers
27  *
28  *  if (PIE1bits.TXIE && PIR1bits.TXIF)
29  *      msg_sendnext();
30  *
31  *  if (PIE1bits.RCIE && PIR1bits.RCIF)
32  *      msg_recvnext();
33  *
34  */
35
36 #endif  /* SERIAL_H */
37