summaryrefslogtreecommitdiff
path: root/include/driver
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-02-26 19:16:55 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-02-26 19:16:55 +0100
commitbdb1590839e5962741140ce2f4db722219f9d6f6 (patch)
treedb565f530096ad63c82640150718fb144c47d9c9 /include/driver
parent9a3d3bcc93f8cefea74af2a86b5834a57738e2c3 (diff)
Add SCD4x driver and datalog integration
Diffstat (limited to 'include/driver')
-rw-r--r--include/driver/scd4x.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/driver/scd4x.h b/include/driver/scd4x.h
new file mode 100644
index 0000000..19ba20d
--- /dev/null
+++ b/include/driver/scd4x.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2021 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#ifndef SCD4x_H
+#define SCD4x_H
+
+class SCD4x {
+ private:
+ SCD4x(const SCD4x &copy);
+ unsigned char const address = 0x62;
+ unsigned char txbuf[2];
+ unsigned char rxbuf[9];
+
+ public:
+ SCD4x() {}
+
+ unsigned short co2;
+ unsigned short rawTemperature;
+ unsigned short rawHumidity;
+
+ void start();
+ void stop();
+
+ void startLowPower();
+ void stopLowPower();
+
+ void read();
+};
+
+extern SCD4x scd4x;
+
+#endif