diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2017-05-02 21:15:14 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2017-05-02 21:15:14 +0200 |
commit | de57772e2027729e76482a2771d60f444a975036 (patch) | |
tree | 9d694deff1ff1e2261ae0190044486d8414eb05e /floppyMusic/uart.h | |
parent | 677c370834102ae43ce19d0931cc98d8267dacc5 (diff) | |
download | avrFloppy-de57772e2027729e76482a2771d60f444a975036.tar.gz |
added UART Library
Diffstat (limited to 'floppyMusic/uart.h')
-rw-r--r-- | floppyMusic/uart.h | 28 |
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 |