Initial import of goggles v2
[goggles] / serial.h
CommitLineData
5fc23db2
JM
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
11extern char outbuff[];
12char inbuff[];
13
14void serial_init(void);
15
16bool msg_empty(void);
17void msg_write(const char *msg);
18void msg_writebyte(const char msg);
19void msg_sendnext(void);
20
21void msg_recvnext(void);
22bool msg_recvready(void);
23char msg_recv(void);
24void putch(char);
25inline void msg_flush(void);
26
27
28/* TODO Connect serial interupt handlers
29 *
30 * if (PIE1bits.TXIE && PIR1bits.TXIF)
31 * msg_sendnext();
32 *
33 * if (PIE1bits.RCIE && PIR1bits.RCIF)
34 * msg_recvnext();
35 *
36 */
37
38#endif /* SERIAL_H */
39