SELKIELogger
1.0.0
|
Functions | |
bool | i2c_ina219_configure (const int busHandle, const int devAddr) |
Send configuration command to the specified device. More... | |
uint16_t | i2c_ina219_read_configuration (const int busHandle, const int devAddr) |
Read configuration from device. More... | |
float | i2c_ina219_read_shuntVoltage (const int busHandle, const int devAddr, const void *opts) |
Get voltage across the shunt resistor in millivolts. More... | |
float | i2c_ina219_read_busVoltage (const int busHandle, const int devAddr, const void *opts) |
Get bus voltage (at V- terminal) in volts. More... | |
float | i2c_ina219_read_power (const int busHandle, const int devAddr, const void *opts) |
Get power consumption in watts. More... | |
float | i2c_ina219_read_current (const int busHandle, const int devAddr, const void *opts) |
Get current flow through shunt resistor in amps. More... | |
bool i2c_ina219_configure | ( | const int | busHandle, |
const int | devAddr | ||
) |
Send configuration command to the specified device.
Connect to specified device address and set configuration to defaults set at compile time.
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an INA219 sensor |
Definition at line 40 of file I2C-INA219.c.
float i2c_ina219_read_busVoltage | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get bus voltage (at V- terminal) in volts.
Connects to specified device address, reads the contents of the bus voltage register and converts the value to a floating point number.
Bus voltage is measured at the V- terminal.
If the overflow or invalid data flags are set, will return NAN
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an INA219 sensor |
Definition at line 115 of file I2C-INA219.c.
uint16_t i2c_ina219_read_configuration | ( | const int | busHandle, |
const int | devAddr | ||
) |
Read configuration from device.
Connect to specified device address and read configuration
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an INA219 sensor |
Definition at line 59 of file I2C-INA219.c.
float i2c_ina219_read_current | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get current flow through shunt resistor in amps.
Connects to specified device address, reads the contents of the current register and converts the value to a floating point number.
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an INA219 sensor |
Definition at line 173 of file I2C-INA219.c.
float i2c_ina219_read_power | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get power consumption in watts.
Connects to specified device address, reads the contents of the power register and converts the value to a floating point number.
This is calculated internally from successive (but not concurrent) voltage and current measurements, so may be inaccurate for very high frequency variations.
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an INA219 sensor |
Definition at line 148 of file I2C-INA219.c.
float i2c_ina219_read_shuntVoltage | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get voltage across the shunt resistor in millivolts.
Connects to specified device address, reads the contents of the shunt voltage register and converts the value to a floating point number.
Out of range values are pinned to zero.
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an INA219 sensor |
Definition at line 77 of file I2C-INA219.c.