summaryrefslogtreecommitdiff
path: root/src/arch/rm46l8lp/driver/stdout.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/rm46l8lp/driver/stdout.cc')
-rw-r--r--src/arch/rm46l8lp/driver/stdout.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/arch/rm46l8lp/driver/stdout.cc b/src/arch/rm46l8lp/driver/stdout.cc
new file mode 100644
index 0000000..9d5403c
--- /dev/null
+++ b/src/arch/rm46l8lp/driver/stdout.cc
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2022 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#include "driver/stdout.h"
+#include "sci.h"
+
+void StandardOutput::setup()
+{
+ sciInit();
+}
+
+void StandardOutput::put(char c)
+{
+ while ((scilinREG->FLR & 0x04) == 0x04);
+ sciSendByte(scilinREG, c);
+ if (c == '\n') {
+ put('\r');
+ }
+}
+
+StandardOutput kout;