a

Revision:
0:3a05c5755625
Child:
1:e0ebc6af5e04
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/INA226.hpp	Sat Nov 24 18:15:16 2012 +0000
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2011 Toshihisa T
+ * Released under the MIT License: http://mbed.org/license/mit
+ */
+#ifndef __INA226_INCLUDE    // {
+#define __INA226_INCLUDE
+#include "mbed.h"
+class INA226 {
+    public:
+        INA226(I2C &i2c_,int addr_ = 0x80,int freq_ = 100000);
+        int isExist(void);
+        int rawRead(char pointer_addr,unsigned short *val_);
+        int rawWrite(char pointer_addr,unsigned short val_);
+        int getVoltage(double *V_);
+        int getCurrent(double *I_);
+        int setCurrentCalibration(unsigned short val = 0x0A00);
+
+    private:
+        I2C &i2c;
+        int i2c_addr;
+        int freq;
+};
+#endif  // }