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.
Fork of INA226 by
INA226 Class Reference
#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_addr INA226 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_addr INA226 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:
-
val write value;
- Returns:
- 0:Read OK / !0:Read NG
Definition at line 82 of file INA226.cpp.
Generated on Sun Jul 17 2022 01:28:42 by
