aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/hal/host
diff options
context:
space:
mode:
Diffstat (limited to 'pyecsca/codegen/hal/host')
-rw-r--r--pyecsca/codegen/hal/host/Makefile.host10
-rw-r--r--pyecsca/codegen/hal/host/host_hal.c2
-rw-r--r--pyecsca/codegen/hal/host/host_hal.h14
-rw-r--r--pyecsca/codegen/hal/host/uart.c7
-rw-r--r--pyecsca/codegen/hal/host/uart.h13
5 files changed, 46 insertions, 0 deletions
diff --git a/pyecsca/codegen/hal/host/Makefile.host b/pyecsca/codegen/hal/host/Makefile.host
new file mode 100644
index 0000000..933c899
--- /dev/null
+++ b/pyecsca/codegen/hal/host/Makefile.host
@@ -0,0 +1,10 @@
+VPATH += :$(HALPATH)/host
+SRC += uart.c host_hal.c
+EXTRAINCDIRS += $(HALPATH)/host
+
+CC = gcc
+OBJCOPY = objcopy
+OBJDUMP = objdump
+SIZE = size
+AR = ar rcs
+NM = nm \ No newline at end of file
diff --git a/pyecsca/codegen/hal/host/host_hal.c b/pyecsca/codegen/hal/host/host_hal.c
new file mode 100644
index 0000000..fe71aab
--- /dev/null
+++ b/pyecsca/codegen/hal/host/host_hal.c
@@ -0,0 +1,2 @@
+
+void platform_init(void) {} \ No newline at end of file
diff --git a/pyecsca/codegen/hal/host/host_hal.h b/pyecsca/codegen/hal/host/host_hal.h
new file mode 100644
index 0000000..b78172c
--- /dev/null
+++ b/pyecsca/codegen/hal/host/host_hal.h
@@ -0,0 +1,14 @@
+#ifndef HOST_HAL_H_
+#define HOST_HAL_H_
+
+#include "uart.h"
+
+#define trigger_setup()
+#define trigger_high()
+#define trigger_low()
+
+#define init_uart init_uart0
+#define putch output_ch_0
+#define getch input_ch_0
+
+#endif //HOST_HAL_H_
diff --git a/pyecsca/codegen/hal/host/uart.c b/pyecsca/codegen/hal/host/uart.c
new file mode 100644
index 0000000..3931d6d
--- /dev/null
+++ b/pyecsca/codegen/hal/host/uart.c
@@ -0,0 +1,7 @@
+#include "uart.h"
+
+void init_uart0(void) {}
+
+char input_ch_0(void) { return getchar(); }
+
+void output_ch_0(char data) { putchar(data); } \ No newline at end of file
diff --git a/pyecsca/codegen/hal/host/uart.h b/pyecsca/codegen/hal/host/uart.h
new file mode 100644
index 0000000..d6063bc
--- /dev/null
+++ b/pyecsca/codegen/hal/host/uart.h
@@ -0,0 +1,13 @@
+#ifndef UART_H_
+#define UART_H_
+
+#include <stdio.h>
+
+
+void init_uart0(void);
+
+char input_ch_0(void);
+
+void output_ch_0(char data);
+
+#endif //UART_H_ \ No newline at end of file