From de57772e2027729e76482a2771d60f444a975036 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Tue, 2 May 2017 21:15:14 +0200 Subject: added UART Library --- floppyMusic/uart.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 floppyMusic/uart.c (limited to 'floppyMusic/uart.c') diff --git a/floppyMusic/uart.c b/floppyMusic/uart.c new file mode 100644 index 0000000..d4d5ccf --- /dev/null +++ b/floppyMusic/uart.c @@ -0,0 +1,40 @@ +/* + * uart.c + * + * Created: 02.05.2017 20:48:26 + * Author: Jonas + */ + + #include "uart.h" + + void uart_init(uint32_t _baud) + { + unsigned int ubrr = _GET_UBBR(_baud); + + UBRRH = (ubrr<<8); + UBRRL = ubrr; + } + + void uart_send(char _data) + { + while(!(UCSRA & (1<