Major changes to the XPLAINBridge software UART code for performance and reliability...
[pub/lufa.git] / Projects / XPLAINBridge / Lib / SoftUART.h
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2010.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
7 */
8
9 /*
10 Copyright 2010 David Prentice (david.prentice [at] farming [dot] uk)
11 Copyright 2010 Peter Danneger
12 Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
13
14 Permission to use, copy, modify, distribute, and sell this
15 software and its documentation for any purpose is hereby granted
16 without fee, provided that the above copyright notice appear in
17 all copies and that both that the copyright notice and this
18 permission notice and warranty disclaimer appear in supporting
19 documentation, and that the name of the author not be used in
20 advertising or publicity pertaining to distribution of the
21 software without specific, written prior permission.
22
23 The author disclaim all warranties with regard to this
24 software, including all implied warranties of merchantability
25 and fitness. In no event shall the author be liable for any
26 special, indirect or consequential damages or any damages
27 whatsoever resulting from loss of use, data or profits, whether
28 in an action of contract, negligence or other tortious action,
29 arising out of or in connection with the use or performance of
30 this software.
31 */
32
33 #ifndef _SOFT_UART_
34 #define _SOFT_UART_
35
36 /* Includes: */
37 #include <avr/io.h>
38 #include <avr/interrupt.h>
39 #include <stdbool.h>
40
41 #include "../XPLAINBridge.h"
42 #include "LightweightRingBuff.h"
43
44 /* Macros: */
45 #define BAUD 9600
46 #define BIT_TIME ((F_CPU / BAUD) - 1)
47
48 #define SRX PD0
49 #define SRXPIN PIND
50 #define SRXPORT PORTD
51
52 #define STX PD1
53 #define STXPORT PORTD
54 #define STXDDR DDRD
55
56 /* Function Prototypes: */
57 void SoftUART_Init(void);
58
59 #endif