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.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 floppyMusic/uart.h (limited to 'floppyMusic/uart.h') diff --git a/floppyMusic/uart.h b/floppyMusic/uart.h new file mode 100644 index 0000000..4943af9 --- /dev/null +++ b/floppyMusic/uart.h @@ -0,0 +1,28 @@ +/* + * uart.h + * + * Created: 02.05.2017 20:48:16 + * Author: Jonas + */ + + +#ifndef UART_H_ +#define UART_H_ + +#ifndef F_CPU +#define F_CPU 16000000UL //CPU Running at 16MHz +#endif + +#include + +#define _GET_UBBR(BAUD) ( (F_CPU / 16 * BAUD) - 1) + +void uart_init(uint32_t _baud); + +void uart_send(char _data); + +void uart_send_string(char *_data); + +char uart_recieve(void); + +#endif /* UART_H_ */ \ No newline at end of file -- cgit v1.2.3