tools: Initially add i2c tool and mock

The power-utils will invoke i2c get/set commands to the i2c device for
PSU code update.
Create a separated i2c tool because it is logically standalone and could
be shared for other utils.
Also add an I2CInterface and its mock to make it easier to test when
developing i2c related operations.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: If5383547e6d84c0a79610e2d2d6f2fa8ee9dc061
diff --git a/tools/i2c/i2c.cpp b/tools/i2c/i2c.cpp
new file mode 100644
index 0000000..fdf0732
--- /dev/null
+++ b/tools/i2c/i2c.cpp
@@ -0,0 +1,73 @@
+#include "i2c.hpp"
+
+namespace i2c
+{
+
+void I2CDevice::read(uint8_t& data)
+{
+    // TODO
+    (void)data;
+}
+
+void I2CDevice::read(uint8_t addr, uint8_t& data)
+{
+    // TODO
+    (void)addr;
+    (void)data;
+}
+
+void I2CDevice::read(uint8_t addr, uint16_t& data)
+{
+    // TODO
+    (void)addr;
+    (void)data;
+}
+
+void I2CDevice::read(uint8_t addr, uint8_t& size, uint8_t* data)
+{
+    // TODO
+    (void)addr;
+    (void)size;
+    (void)data;
+}
+
+void I2CDevice::write(uint8_t data)
+{
+    // TODO
+    (void)data;
+}
+
+void I2CDevice::write(uint8_t addr, uint8_t data)
+{
+    // TODO
+    (void)addr;
+    (void)data;
+}
+
+void I2CDevice::write(uint8_t addr, uint16_t data)
+{
+    // TODO
+    (void)addr;
+    (void)data;
+}
+
+void I2CDevice::write(uint8_t addr, uint8_t size, const uint8_t* data)
+{
+    // TODO
+    (void)addr;
+    (void)size;
+    (void)data;
+}
+
+std::unique_ptr<I2CInterface> I2CDevice::create(uint8_t busId, uint8_t devAddr)
+{
+    std::unique_ptr<I2CDevice> dev(new I2CDevice(busId, devAddr));
+    return dev;
+}
+
+std::unique_ptr<I2CInterface> create(uint8_t busId, uint8_t devAddr)
+{
+    return I2CDevice::create(busId, devAddr);
+}
+
+} // namespace i2c