]> rtime.felk.cvut.cz Git - fpga/virtex2/uart.git/blobdiff - software/uart.c
Software modification to work whit HW UART
[fpga/virtex2/uart.git] / software / uart.c
diff --git a/software/uart.c b/software/uart.c
new file mode 100644 (file)
index 0000000..1c57831
--- /dev/null
@@ -0,0 +1,14 @@
+#include "hardware.h"
+#include "uart.h"
+
+int putchar(int c) {
+  while (USTAT & 0x20) {}
+  UTX = c;
+  return 0;
+}
+
+int getchar() {
+  while (!(USTAT & 0x10)) {}
+  return URX;
+}
+