Loading include/driver/lm75.h +2 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ class LM75 { LM75(unsigned char const addr) : address(addr) {} float getTemp(); unsigned int getOS(); unsigned int getHyst(); void setOS(unsigned char os); void setHyst(unsigned char hyst); }; Loading src/driver/lm75.cc +18 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,24 @@ float LM75::getTemp() return rxbuf[0] + (rxbuf[1] / 256.0); } unsigned int LM75::getOS() { txbuf[0] = 0x03; rxbuf[0] = 0; rxbuf[1] = 0; i2c.xmit(address, 1, txbuf, 2, rxbuf); return rxbuf[0]; } unsigned int LM75::getHyst() { txbuf[0] = 0x02; rxbuf[0] = 0; rxbuf[1] = 0; i2c.xmit(address, 1, txbuf, 2, rxbuf); return rxbuf[0]; } void LM75::setOS(unsigned char os) { txbuf[0] = 0x03; Loading Loading
include/driver/lm75.h +2 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ class LM75 { LM75(unsigned char const addr) : address(addr) {} float getTemp(); unsigned int getOS(); unsigned int getHyst(); void setOS(unsigned char os); void setHyst(unsigned char hyst); }; Loading
src/driver/lm75.cc +18 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,24 @@ float LM75::getTemp() return rxbuf[0] + (rxbuf[1] / 256.0); } unsigned int LM75::getOS() { txbuf[0] = 0x03; rxbuf[0] = 0; rxbuf[1] = 0; i2c.xmit(address, 1, txbuf, 2, rxbuf); return rxbuf[0]; } unsigned int LM75::getHyst() { txbuf[0] = 0x02; rxbuf[0] = 0; rxbuf[1] = 0; i2c.xmit(address, 1, txbuf, 2, rxbuf); return rxbuf[0]; } void LM75::setOS(unsigned char os) { txbuf[0] = 0x03; Loading