diff options
-rw-r--r-- | include/driver/max44006.h | 21 | ||||
-rw-r--r-- | src/driver/Kconfig | 4 | ||||
-rw-r--r-- | src/driver/max44006.cc | 71 |
3 files changed, 0 insertions, 96 deletions
diff --git a/include/driver/max44006.h b/include/driver/max44006.h deleted file mode 100644 index e357574..0000000 --- a/include/driver/max44006.h +++ /dev/null @@ -1,21 +0,0 @@ -#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/src/driver/Kconfig b/src/driver/Kconfig index a8cf683..ef162a7 100644 --- a/src/driver/Kconfig +++ b/src/driver/Kconfig @@ -48,10 +48,6 @@ bool "LM75 Temperature Sensor" depends on meta_driver_i2c # depends on I2C -config driver_max44006 -bool "MAX44006 RGB Sensor" -depends on meta_driver_i2c - config driver_max44009 bool "MAX44009 Ambient Light Sensor" depends on meta_driver_i2c diff --git a/src/driver/max44006.cc b/src/driver/max44006.cc deleted file mode 100644 index a61e7df..0000000 --- a/src/driver/max44006.cc +++ /dev/null @@ -1,71 +0,0 @@ -#include "driver/max44006.h" -#include "arch.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) -#include "driver/i2c.h" -#else -#include "driver/soft_i2c.h" -#endif - -signed char MAX44006::setup() -{ - txbuf[0] = 0; - txbuf[1] = 0; - i2c.xmit(2, txbuf, 0, rxbuf); - - arch.delay_us(10); - - txbuf[0] = 0x01; - txbuf[1] = 0x20; - i2c.xmit(2, txbuf, 0, rxbuf); - - arch.delay_us(10); - - txbuf[0] = 0x02; - txbuf[1] = 0x02; - i2c.xmit(2, txbuf, 0, rxbuf); - - return 0; -} - -void MAX44006::wakeup() -{ - txbuf[0] = 0; - txbuf[1] = 0; - i2c.xmit(2, txbuf, 0, rxbuf); -} - -void MAX44006::sleep() -{ - txbuf[0] = 0x00; - txbuf[1] = 0x08; - - i2c.xmit(2, txbuf, 0, rxbuf); -} - -float LM75::getTemp() -{ - txbuf[0] = 0; - rxbuf[0] = 0; - rxbuf[1] = 0; - i2c.xmit(address, 1, txbuf, 2, rxbuf); - - return rxbuf[0] + (rxbuf[1] / 256.0); -} - -void LM75::setOS(unsigned char os) -{ - txbuf[0] = 0x03; - txbuf[1] = os; - txbuf[2] = 0; - i2c.xmit(address, 3, txbuf, 0, rxbuf); -} - -void LM75::setHyst(unsigned char hyst) -{ - txbuf[0] = 0x02; - txbuf[1] = hyst; - txbuf[2] = 0; - i2c.xmit(address, 3, txbuf, 0, rxbuf); -} - -MAX44006 max44006(0x45); |