Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
INA226 Class Reference
#include <INA226.hpp>
Public Member Functions | |
INA226 (I2C &i2c_, int addr_=0x80, 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_ = 0x80 , |
||
int | freq_ = 100000 |
||
) |
Constructor.
- Parameters:
-
i2c_ instance of I2C. addr_ I2C slave address. freq_ I2C frequency.
Definition at line 5 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 58 of file INA226.cpp.
int getVoltage | ( | double * | V_ ) |
Get voltage.
- Parameters:
-
V_ read value;
- Returns:
- 0:Read OK / !0:Read NG
Definition at line 48 of file INA226.cpp.
int isExist | ( | void | ) |
Check INA226 exist.
- Parameters:
-
none
- Returns:
- 0:NOT EXIST / !0:EXIST
Definition at line 10 of file INA226.cpp.
int rawRead | ( | char | pointer_addr, |
unsigned short * | val_ | ||
) |
INA226 raw level read.
- Parameters:
-
pointer_addr INA226 pointer address. val_ read value.
- Returns:
- 0:Read OK / !0:Read NG
Definition at line 33 of file INA226.cpp.
int rawWrite | ( | char | pointer_addr, |
unsigned short | val_ | ||
) |
INA226 raw level write.
- Parameters:
-
pointer_addr INA226 pointer address. val_ write value.
- Returns:
- 0:Read OK / !0:Read NG
Definition at line 20 of file INA226.cpp.
int setCurrentCalibration | ( | unsigned short | val = 0x0A00 ) |
Set current calibration.
- Parameters:
-
val write value;
- Returns:
- 0:Read OK / !0:Read NG
Definition at line 73 of file INA226.cpp.
Generated on Tue Jul 12 2022 15:46:14 by
