From c6ac90fc731d8411380f582be3b91ce4e93f61fc Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Mon, 11 Apr 2011 05:44:51 +0200 Subject: Create I2CSensor class and subclasses for each sensor. --- i2csensor.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 i2csensor.h (limited to 'i2csensor.h') diff --git a/i2csensor.h b/i2csensor.h new file mode 100644 index 0000000..1878e16 --- /dev/null +++ b/i2csensor.h @@ -0,0 +1,26 @@ +#ifndef I2CSENSOR_H +#define I2CSENSOR_H + +#include + +#include +#include + +class I2CSensor { + private: + static I2CSlaveConfig i2c_slave_conf; + + public: + static void enable_bus(); + + protected: + uint8_t i2c_address; + + void write(uint8_t reg, uint8_t value); + void read(uint8_t reg, size_t len); + + static uint8_t rxdata[8]; + static uint8_t txdata[2]; +}; + +#endif -- cgit v1.2.3