5 Copyright John Steggall 2009
11 Copyright 2009 John Steggall (steggall.j@gmail.com)
13 Permission to use, copy, modify, and distribute this software
14 and its documentation for any purpose and without fee is hereby
15 granted, provided that the above copyright notice appear in all
16 copies and that both that the copyright notice and this
17 permission notice and warranty disclaimer appear in supporting
18 documentation, and that the name of the author not be used in
19 advertising or publicity pertaining to distribution of the
20 software without specific, written prior permission.
22 The author disclaim all warranties with regard to this
23 software, including all implied warranties of merchantability
24 and fitness. In no event shall the author be liable for any
25 special, indirect or consequential damages or any damages
26 whatsoever resulting from loss of use, data or profits, whether
27 in an action of contract, negligence or other tortious action,
28 arising out of or in connection with the use or performance of
33 Specifically designed for the xplain board, other uses could be made by furkling through the code
34 and replacing the port and pin assignments. Also relies on and external interupt to detect the low
35 level of the start bit, in this case INT0.
36 Always configured to 9600baud. Can be changed by setting the BITLENGTH define to F_CPU/(desired baud)
37 code may need optimising when getting any faster to sample the bit in the correct place. No
38 compensation has been made for the response time of the int routine.
44 /* initialises software uart and enables transmit */
45 extern void SoftUART_Init(void);
47 /* checks if there is a byte in the receive buffer*/
48 extern unsigned char SoftUART_IsReceived(void);
50 /* returns the received byte */
51 extern unsigned char SoftUART_RxByte(void);
53 /* starts a byte send and returns the byte to be sent */
54 extern unsigned char SoftUART_TxByte(unsigned char data
);
56 /* Simulates polling UDRE to see if tx buffer is empty and ready */
57 extern unsigned char SoftUART_IsReady(void);