summaryrefslogtreecommitdiff
path: root/include/driver
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-12-14 15:51:11 +0100
committerDaniel Friesel <derf@finalrewind.org>2017-12-14 15:51:11 +0100
commit51a00f59ea9ecb49471b30921f36821fdfa75bc4 (patch)
tree4c237974cf044d5a7067aba48070ad7f6e3c7d11 /include/driver
parent693afffd7b89507916ecd759767b0b7e947dca60 (diff)
Add I2C and LM75 drivers
Diffstat (limited to 'include/driver')
-rw-r--r--include/driver/lm75.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/driver/lm75.h b/include/driver/lm75.h
new file mode 100644
index 0000000..e357574
--- /dev/null
+++ b/include/driver/lm75.h
@@ -0,0 +1,21 @@
+#ifndef LM75_H
+#define LM75_H
+
+class LM75 {
+ private:
+ LM75(const LM75 &copy);
+ unsigned char const address;
+ unsigned char txbuf[3];
+ unsigned char rxbuf[2];
+
+ public:
+ LM75(unsigned char const addr) : address(addr) {}
+
+ float getTemp();
+ void setOS(unsigned char os);
+ void setHyst(unsigned char hyst);
+};
+
+extern LM75 lm75;
+
+#endif