summaryrefslogtreecommitdiff
path: root/floppyMusic/uart.h
diff options
context:
space:
mode:
Diffstat (limited to 'floppyMusic/uart.h')
-rw-r--r--floppyMusic/uart.h28
1 files changed, 28 insertions, 0 deletions
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 <avr/io.h>
+
+#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