summaryrefslogtreecommitdiff
path: root/src/app/ccs811test
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-05-24 09:09:58 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-05-24 09:09:58 +0200
commitef918672a6415f862fa7b44d185088eee1816b7c (patch)
treef990cd60603826000f4ab31776824fc3f7704489 /src/app/ccs811test
parentc0b7a8420fb4105c0dd86d1eaf35f6e339769570 (diff)
add dysfunctional ccs811 test app
Diffstat (limited to 'src/app/ccs811test')
-rw-r--r--src/app/ccs811test/Makefile.inc3
-rw-r--r--src/app/ccs811test/main.cc34
2 files changed, 37 insertions, 0 deletions
diff --git a/src/app/ccs811test/Makefile.inc b/src/app/ccs811test/Makefile.inc
new file mode 100644
index 0000000..b6920c9
--- /dev/null
+++ b/src/app/ccs811test/Makefile.inc
@@ -0,0 +1,3 @@
+arch_drivers += ,i2c
+drivers += ,ccs811
+loop ?= 1
diff --git a/src/app/ccs811test/main.cc b/src/app/ccs811test/main.cc
new file mode 100644
index 0000000..a1052f6
--- /dev/null
+++ b/src/app/ccs811test/main.cc
@@ -0,0 +1,34 @@
+#include "arch.h"
+#include "driver/gpio.h"
+#include "driver/stdout.h"
+#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C)
+#include "driver/i2c.h"
+#else
+#include "driver/soft_i2c.h"
+#endif
+#include "driver/ccs811.h"
+
+void loop(void)
+{
+ kout << "CCS811 status is " << ccs811.check() << endl;
+}
+
+int main(void)
+{
+
+ arch.setup();
+ gpio.setup();
+ kout.setup();
+
+ if (i2c.setup() != 0) {
+ return 1;
+ }
+
+ kout << "I2C setup OK" << endl;
+
+ ccs811.init();
+
+ arch.idle_loop();
+
+ return 0;
+}