summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-10-15 15:32:37 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-10-15 15:32:37 +0200
commita00d69c60a66b997bad1351d0eb94cd50465d6b0 (patch)
treecb7b9e657157d8f21378f04675586c2eb99619d7 /src
parent652ef7e250fdbd15e185d6b2864d251d0e49482f (diff)
i2cdetect: Add initial CCS811 support
Diffstat (limited to 'src')
-rw-r--r--src/app/i2cdetect/main.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/app/i2cdetect/main.cc b/src/app/i2cdetect/main.cc
index 4ec49d9..a31dbc9 100644
--- a/src/app/i2cdetect/main.cc
+++ b/src/app/i2cdetect/main.cc
@@ -12,6 +12,9 @@
#ifdef DRIVER_AM2320
#include "driver/am2320.h"
#endif
+#ifdef DRIVER_CCS811
+#include "driver/ccs811.h"
+#endif
#ifdef DRIVER_EEPROM24LC64
#include "driver/eeprom24lc64.h"
#endif
@@ -39,6 +42,9 @@ void loop(void)
kout << "AM2320 error " << dec << am2320.getStatus() << endl;
}
#endif
+#ifdef DRIVER_CCS811
+ kout << "CCS811 status is " << ccs811.check() << endl;
+#endif
#ifdef DRIVER_MAX44009
kout.printf_float(max44009.getLux());
kout << endl;
@@ -73,6 +79,10 @@ int main(void)
kout << "I2C setup OK" << endl;
+#ifdef DRIVER_CCS811
+ ccs811.init();
+#endif
+
for (unsigned char i = 0; i < sizeof(i2c_status)/sizeof(unsigned int); i++) {
i2c_status[i] = 0;
}