The INA219 is a high-side current shunt and power monitor with an I2C interface. The INA219 monitors both shunt drop and supply voltage, with programmable conversion times and filtering. A programmable calibration value, combined with an internal multiplier, enables direct readouts in amperes. An additional multiplying register calculates power in watts. The I2C interface features 16 programmable addresses.

Dependents:   INA219TEST

Fork of INA219 by Michael Ammann

Revision:
3:c4a937ab46bf
Parent:
2:a123ae7c1e4b
--- a/INA219.h	Fri Nov 22 08:36:36 2013 +0000
+++ b/INA219.h	Mon Jun 30 08:27:27 2014 +0000
@@ -16,13 +16,16 @@
 class INA219
 {
 public: 
-    INA219(PinName sda, PinName scl, 
-            unsigned char adr /* range 0x80(1000000)-0x9E(1001111) */);
+    INA219(PinName sda, PinName scl,
+        unsigned char adr /* range 0x80(1000000)-0x9E(1001111) */,
+        int hz);
     bool detect(void);
+    I2C getI2C(void);
     double getCurrent(void);
     double getVoltage(void);
+    unsigned short getRegister(unsigned char reg);
+    bool getRegister(unsigned char reg, unsigned short *data);
+    unsigned char Address;
 protected:
-    bool _det;
-    unsigned char _adr;
     I2C _i2c;
 };