From 51a00f59ea9ecb49471b30921f36821fdfa75bc4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 14 Dec 2017 15:51:11 +0100 Subject: Add I2C and LM75 drivers --- include/driver/lm75.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/driver/lm75.h (limited to 'include/driver/lm75.h') 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 ©); + 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 -- cgit v1.2.3