aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/hal/xmega/uart.h
diff options
context:
space:
mode:
authorJ08nY2019-11-21 19:10:50 +0100
committerJ08nY2019-11-21 19:10:50 +0100
commitc8d0bff46001bd5636825c5b0bb4c896cb34a4e6 (patch)
tree2b3029c6ca37e56e86daa34069ab39da3b1a5400 /pyecsca/codegen/hal/xmega/uart.h
downloadpyecsca-codegen-c8d0bff46001bd5636825c5b0bb4c896cb34a4e6.tar.gz
pyecsca-codegen-c8d0bff46001bd5636825c5b0bb4c896cb34a4e6.tar.zst
pyecsca-codegen-c8d0bff46001bd5636825c5b0bb4c896cb34a4e6.zip
Initialize.
Diffstat (limited to 'pyecsca/codegen/hal/xmega/uart.h')
-rw-r--r--pyecsca/codegen/hal/xmega/uart.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/pyecsca/codegen/hal/xmega/uart.h b/pyecsca/codegen/hal/xmega/uart.h
new file mode 100644
index 0000000..b7a6be6
--- /dev/null
+++ b/pyecsca/codegen/hal/xmega/uart.h
@@ -0,0 +1,23 @@
+#ifndef UART_H_
+#define UART_H_
+
+#include "usart_driver.h"
+#include "avr_compiler.h"
+
+
+//Init UART0, set to baud rate as defined in header file
+void init_uart0(void);
+
+//Input a char on UART0 and store it to data, however if no char is recieved
+//within timeout, then abort and return TIMEOUT, otherwise return BYTE_REC
+//(note: timeout is NOT a reliable value, as it uses a simple C loop that
+//will change with different compiler settings likely
+unsigned char input_ch_w_timeout_0(char * data, unsigned int timeout);
+
+//wait forever for a char on UART 0 and return it
+char input_ch_0(void);
+
+//output char data on UART0
+void output_ch_0(char data);
+
+#endif //UART_H_ \ No newline at end of file