1月14日にRS485R_2をパブリッシュしようとしたらこれをパブリッシュしろと言われたのでしました。

Fork of INA226 by Toshihisa T

Embed: (wiki syntax)

« Back to documentation index

INA226 Class Reference

INA226 Class Reference

INA226 Class. More...

#include <INA226.hpp>

Public Member Functions

 INA226 (I2C &i2c_, int addr_=0x94, int freq_=100000)
 Constructor.
int isExist (void)
 Check INA226 exist.
int rawRead (char pointer_addr, unsigned short *val_)
 INA226 raw level read.
int rawWrite (char pointer_addr, unsigned short val_)
 INA226 raw level write.
int getVoltage (double *V_)
 Get voltage.
int getCurrent (double *I_)
 Get current.
int setCurrentCalibration (unsigned short val=0x0A00)
 Set current calibration.

Detailed Description

INA226 Class.

Definition at line 17 of file INA226.hpp.


Constructor & Destructor Documentation

INA226 ( I2C &  i2c_,
int  addr_ = 0x94,
int  freq_ = 100000 
)

Constructor.

Parameters:
i2c_instance of I2C.
addr_I2C slave address.
freq_I2C frequency.

LICENSE

Released under the MIT License: http://mbed.org/license/mit Copyright (C) 2012 tosihisa

DESCRIPTION

INA226 - Bi-Directional CURRENT/POWER MONITOR with I2C http://strawberry-linux.com/catalog/items?code=12031

Definition at line 14 of file INA226.cpp.


Member Function Documentation

int getCurrent ( double *  I_ )

Get current.

Parameters:
I_read value;
Returns:
0:Read OK / !0:Read NG

Definition at line 67 of file INA226.cpp.

int getVoltage ( double *  V_ )

Get voltage.

Parameters:
V_read value;
Returns:
0:Read OK / !0:Read NG

Definition at line 57 of file INA226.cpp.

int isExist ( void   )

Check INA226 exist.

Parameters:
none
Returns:
0:NOT EXIST / !0:EXIST

Definition at line 19 of file INA226.cpp.

int rawRead ( char  pointer_addr,
unsigned short *  val_ 
)

INA226 raw level read.

Parameters:
pointer_addrINA226 pointer address.
val_read value.
Returns:
0:Read OK / !0:Read NG

Definition at line 42 of file INA226.cpp.

int rawWrite ( char  pointer_addr,
unsigned short  val_ 
)

INA226 raw level write.

Parameters:
pointer_addrINA226 pointer address.
val_write value.
Returns:
0:Read OK / !0:Read NG

Definition at line 29 of file INA226.cpp.

int setCurrentCalibration ( unsigned short  val = 0x0A00 )

Set current calibration.

Parameters:
valwrite value;
Returns:
0:Read OK / !0:Read NG

Definition at line 82 of file INA226.cpp.