diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/driver/lm75.h | 21 | ||||
-rw-r--r-- | include/msp430fr5969lp/driver/i2c.h | 19 | ||||
-rw-r--r-- | include/object/outputstream.h | 2 |
3 files changed, 42 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 ©); + 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 diff --git a/include/msp430fr5969lp/driver/i2c.h b/include/msp430fr5969lp/driver/i2c.h new file mode 100644 index 0000000..6d6ea66 --- /dev/null +++ b/include/msp430fr5969lp/driver/i2c.h @@ -0,0 +1,19 @@ +#ifndef I2C_H +#define I2C_H + +class I2C { + private: + I2C(const I2C ©); + + public: + I2C () {} + signed char setup(); + void scan(unsigned int *results); + signed char xmit(unsigned char address, + unsigned char tx_len, unsigned char *tx_buf, + unsigned char rx_len, unsigned char *rx_buf); +}; + +extern I2C i2c; + +#endif diff --git a/include/object/outputstream.h b/include/object/outputstream.h index 43e61f3..4a37977 100644 --- a/include/object/outputstream.h +++ b/include/object/outputstream.h @@ -38,6 +38,8 @@ class OutputStream { OutputStream & operator<<(OutputStream & (*fun) (OutputStream &)); void setBase(uint8_t b); + void printf_uint8(uint8_t num); + void printf_float(float num); }; |