summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-08-07 17:31:59 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-08-07 17:31:59 +0200
commit178835c160940772341615dab7a239c45a875807 (patch)
treec732f59d48c41453cd8c28603ee61f3365fac773 /include
parent8579b2a1023211c86cb1221eb2b44b9221034478 (diff)
Add AM2320 driver
Diffstat (limited to 'include')
-rw-r--r--include/driver/am2320.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/driver/am2320.h b/include/driver/am2320.h
new file mode 100644
index 0000000..39c5f7e
--- /dev/null
+++ b/include/driver/am2320.h
@@ -0,0 +1,22 @@
+#ifndef AM2320_H
+#define AM2320_H
+
+class AM2320 {
+ private:
+ AM2320(const AM2320 &copy);
+ unsigned char const address;
+ unsigned char txbuf[3];
+ unsigned char rxbuf[8];
+
+ public:
+ AM2320(unsigned char const addr) : address(addr) {}
+
+ void read();
+ unsigned char getStatus();
+ float getTemp();
+ float getHumidity();
+};
+
+extern AM2320 am2320;
+
+#endif