summaryrefslogtreecommitdiff
path: root/src/app/posix-stdin-to-ssd1306/main.cc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-11-29 20:41:55 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-11-29 20:41:55 +0100
commit131f82839404f176a82330ac7fda20445a97cd88 (patch)
tree0892541262dd7805e24165d3377e413b75fd099f /src/app/posix-stdin-to-ssd1306/main.cc
parent1b1952efc21d1b243e25e3c6f3d92ddefb419977 (diff)
add POSIX argv → ssd1306 app
Diffstat (limited to 'src/app/posix-stdin-to-ssd1306/main.cc')
-rw-r--r--src/app/posix-stdin-to-ssd1306/main.cc42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/app/posix-stdin-to-ssd1306/main.cc b/src/app/posix-stdin-to-ssd1306/main.cc
new file mode 100644
index 0000000..a3fd085
--- /dev/null
+++ b/src/app/posix-stdin-to-ssd1306/main.cc
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2021 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#include "arch.h"
+#include "driver/stdout.h"
+#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c)
+#include "driver/i2c.h"
+#else
+#include "driver/soft_i2c.h"
+#endif
+#include "driver/ssd1306.h"
+#include "object/framebuffer.h"
+#include "lib/pixelfont/pixeloperator_mirrored.h"
+
+#include <stdio.h>
+
+char buf[32];
+
+void loop()
+{
+}
+
+int main(void)
+{
+ arch.setup();
+ kout.setup();
+ i2c.setup();
+ ssd1306.init();
+
+ fb.clear();
+ ssd1306.showImage(fb.data, fb.width * fb.height / 8);
+ fb.setFont(pixeloperator_mirrored);
+
+ while (fgets(buf, 32, stdin)) {
+ fb << buf;
+ ssd1306.showImage(fb.data, fb.width * fb.height / 8);
+ }
+
+ return 0;
+}