summaryrefslogtreecommitdiff
path: root/src/arch/lm4f120h5qr-stellaris/driver
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-02-18 23:01:57 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-02-18 23:01:57 +0100
commit38f0e84d3b5da56c1441f2f779246ccf7b23d5c4 (patch)
tree9fdb70ca1393ca8de11b11e751feb12c36afb8d3 /src/arch/lm4f120h5qr-stellaris/driver
parentb3cea73a75cb46e39ed7c7e6f765fc842a40fabf (diff)
add minimal LM4F120H5QR (LM4F120XL Stellaris Launchpad) support
Diffstat (limited to 'src/arch/lm4f120h5qr-stellaris/driver')
-rw-r--r--src/arch/lm4f120h5qr-stellaris/driver/gpio.cc8
-rw-r--r--src/arch/lm4f120h5qr-stellaris/driver/stdout.cc26
-rw-r--r--src/arch/lm4f120h5qr-stellaris/driver/uptime.cc8
3 files changed, 42 insertions, 0 deletions
diff --git a/src/arch/lm4f120h5qr-stellaris/driver/gpio.cc b/src/arch/lm4f120h5qr-stellaris/driver/gpio.cc
new file mode 100644
index 0000000..5b17f1e
--- /dev/null
+++ b/src/arch/lm4f120h5qr-stellaris/driver/gpio.cc
@@ -0,0 +1,8 @@
+/*
+ * Copyright 2021 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#include "driver/gpio.h"
+
+GPIO gpio;
diff --git a/src/arch/lm4f120h5qr-stellaris/driver/stdout.cc b/src/arch/lm4f120h5qr-stellaris/driver/stdout.cc
new file mode 100644
index 0000000..18b6da4
--- /dev/null
+++ b/src/arch/lm4f120h5qr-stellaris/driver/stdout.cc
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2021 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#include "driver/stdout.h"
+
+extern "C" {
+#include "lm4f_cpp_wrapper.h"
+};
+
+
+void StandardOutput::setup()
+{
+ mp_uart_setup();
+}
+
+void StandardOutput::put(char c)
+{
+ mp_uart_send_blocking(c);
+ if (c == '\n') {
+ put('\r');
+ }
+}
+
+StandardOutput kout;
diff --git a/src/arch/lm4f120h5qr-stellaris/driver/uptime.cc b/src/arch/lm4f120h5qr-stellaris/driver/uptime.cc
new file mode 100644
index 0000000..7e37a7b
--- /dev/null
+++ b/src/arch/lm4f120h5qr-stellaris/driver/uptime.cc
@@ -0,0 +1,8 @@
+/*
+ * Copyright 2021 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#include "driver/uptime.h"
+
+Uptime uptime;