INA2xx  v1.1.0
Arduino Library to read current, voltage and power data from one or more INA2xx device(s)
INA.h File Reference

INA Class library header file. More...

#include "WProgram.h"

Go to the source code of this file.

Classes

struct  inaEEPROM
 
struct  inaDet
 
class  INA_Class
 Forward definitions for the INA_Class. More...
 

Macros

#define ARDUINO   0
 
#define INA_I2C_MODES
 Guard code to prevent multiple defs.
 

Typedefs

typedef inaDet inaDet
 

Enumerations

enum  ina_Type {
  INA219, INA226, INA228, INA230,
  INA231, INA260, INA3221_0, INA3221_1,
  INA3221_2, INA_UNKNOWN
}
 
enum  ina_Mode {
  INA_MODE_SHUTDOWN, INA_MODE_TRIGGERED_SHUNT, INA_MODE_TRIGGERED_BUS, INA_MODE_TRIGGERED_BOTH,
  INA_MODE_POWER_DOWN, INA_MODE_CONTINUOUS_SHUNT, INA_MODE_CONTINUOUS_BUS, INA_MODE_CONTINUOUS_BOTH
}
 

Variables

const uint32_t INA_I2C_STANDARD_MODE {100000}
 Default normal I2C 100KHz speed.
 
const uint32_t INA_I2C_FAST_MODE {400000}
 Fast mode.
 
const uint32_t INA_I2C_FAST_MODE_PLUS {1000000}
 Really fast mode.
 
const uint32_t INA_I2C_HIGH_SPEED_MODE {3400000}
 Turbo mode.
 
const uint8_t INA_CONFIGURATION_REGISTER {0}
 Configuration Register address.
 
const uint8_t INA_BUS_VOLTAGE_REGISTER {2}
 Bus Voltage Register address.
 
const uint8_t INA_POWER_REGISTER {3}
 Power Register address.
 
const uint8_t INA_CALIBRATION_REGISTER {5}
 Calibration Register address.
 
const uint8_t INA_MASK_ENABLE_REGISTER {6}
 Mask enable Register (some devices)
 
const uint8_t INA_ALERT_LIMIT_REGISTER {7}
 Alert Limit Register (some devices)
 
const uint8_t INA_MANUFACTURER_ID_REGISTER {0xFE}
 Mfgr ID Register (some devices)
 
const uint8_t INA_DIE_ID_REGISTER {0xFF}
 Die ID Register (some devices)
 
const uint16_t INA_RESET_DEVICE {0x8000}
 Write to config to reset device.
 
const uint16_t INA_CONVERSION_READY_MASK {0x0080}
 Bit 4.
 
const uint16_t INA_CONFIG_MODE_MASK {0x0007}
 Bits 0-3.
 
const uint16_t INA_ALERT_MASK {0x03FF}
 Mask off bits 0-9.
 
const uint8_t INA_ALERT_SHUNT_OVER_VOLT_BIT {15}
 Register bit.
 
const uint8_t INA_ALERT_SHUNT_UNDER_VOLT_BIT {14}
 Register bit.
 
const uint8_t INA_ALERT_BUS_OVER_VOLT_BIT {13}
 Register bit.
 
const uint8_t INA_ALERT_BUS_UNDER_VOLT_BIT {12}
 Register bit.
 
const uint8_t INA_ALERT_POWER_OVER_WATT_BIT {11}
 Register bit.
 
const uint8_t INA_ALERT_CONVERSION_RDY_BIT {10}
 Register bit.
 
const uint8_t INA_DEFAULT_OPERATING_MODE {B111}
 Default continuous mode.
 
const uint8_t INA219_SHUNT_VOLTAGE_REGISTER {1}
 INA219 Shunt Voltage Register.
 
const uint8_t INA219_CURRENT_REGISTER {4}
 INA219 Current Register.
 
const uint16_t INA219_BUS_VOLTAGE_LSB {400}
 INA219 LSB in uV *100 4.00mV.
 
const uint16_t INA219_SHUNT_VOLTAGE_LSB {100}
 INA219 LSB in uV *10 10.0uV.
 
const uint16_t INA219_CONFIG_AVG_MASK {0x07F8}
 INA219 Bits 3-6, 7-10.
 
const uint16_t INA219_CONFIG_PG_MASK {0xE7FF}
 INA219 Bits 11-12 masked.
 
const uint16_t INA219_CONFIG_BADC_MASK {0x0780}
 INA219 Bits 7-10 masked.
 
const uint16_t INA219_CONFIG_SADC_MASK {0x0038}
 INA219 Bits 3-5.
 
const uint8_t INA219_BRNG_BIT {13}
 INA219 Bit for BRNG in config reg.
 
const uint8_t INA219_PG_FIRST_BIT {11}
 INA219 1st bit of Programmable Gain.
 
const uint8_t INA226_SHUNT_VOLTAGE_REGISTER {1}
 INA226 Shunt Voltage Register.
 
const uint8_t INA226_CURRENT_REGISTER {4}
 INA226 Current Register.
 
const uint16_t INA226_BUS_VOLTAGE_LSB {125}
 INA226 LSB in uV *100 1.25mV.
 
const uint16_t INA226_SHUNT_VOLTAGE_LSB {25}
 INA226 LSB in uV *10 2.5uV.
 
const uint16_t INA226_CONFIG_AVG_MASK {0x0E00}
 INA226 Bits 9-11.
 
const uint16_t INA226_DIE_ID_VALUE {0x2260}
 INA226 Hard-coded Die ID for INA226.
 
const uint16_t INA226_CONFIG_BADC_MASK {0x01C0}
 INA226 Bits 6-8 masked.
 
const uint16_t INA226_CONFIG_SADC_MASK {0x0038}
 INA226 Bits 3-4.
 
const uint8_t INA228_DIE_ID_REGISTER {0x3F}
 INA228 Device_ID Register.
 
const uint16_t INA228_DIE_ID_VALUE {0x2280}
 INA228 Hard-coded Die ID for INA228.
 
const uint8_t INA228_BUS_VOLTAGE_REGISTER {0x5}
 INA228 Bus Voltage Register.
 
const uint16_t INA228_BUS_VOLTAGE_LSB {195}
 INA228 LSB in uV *100 1953125uV, extra code.
 
const uint8_t INA228_SHUNT_VOLTAGE_REGISTER {4}
 INA228 Shunt Voltage Register.
 
const uint8_t xINA228_CURRENT_REGISTER {4}
 INA228 Current Register.
 
const uint16_t xINA228_CONFIG_AVG_MASK {0x0E00}
 INA228 Bits 9-11.
 
const uint16_t xINA228_CONFIG_BADC_MASK {0x01C0}
 INA228 Bits 6-8 masked.
 
const uint16_t xINA228_CONFIG_SADC_MASK {0x0038}
 INA228 Bits 3-4.
 
const uint8_t INA260_SHUNT_VOLTAGE_REGISTER {0}
 INA260 Register doesn't exist.
 
const uint8_t INA260_CURRENT_REGISTER {1}
 INA260 Current Register.
 
const uint16_t INA260_BUS_VOLTAGE_LSB {125}
 INA260 LSB in uV *100 1.25mV.
 
const uint16_t INA260_CONFIG_BADC_MASK {0x01C0}
 INA260 Bits 6-8 masked.
 
const uint16_t INA260_CONFIG_SADC_MASK {0x0038}
 INA260 Bits 3-5 masked.
 
const uint8_t INA3221_SHUNT_VOLTAGE_REGISTER {1}
 INA3221 Register number 1.
 
const uint16_t INA3221_BUS_VOLTAGE_LSB {800}
 INA3221 LSB in uV *100 8mV.
 
const uint16_t INA3221_SHUNT_VOLTAGE_LSB {400}
 INA3221 LSB in uV *10 40uV.
 
const uint16_t INA3221_CONFIG_BADC_MASK {0x01C0}
 INA3221 Bits 7-10 masked.
 
const uint8_t INA3221_MASK_REGISTER {0xF}
 INA32219 Mask register.
 
const uint8_t I2C_DELAY {10}
 Microsecond delay on I2C writes.
 

Detailed Description

INA Class library header file.

Macro Definition Documentation

◆ ARDUINO

#define ARDUINO   0

Define macro if not defined yet

Typedef Documentation

◆ inaDet

typedef inaDet inaDet

typedef contains a packed bit-level definition of information stored on a device

Enumeration Type Documentation

◆ ina_Mode

enum ina_Mode

Enumerated list detailing the operating modes of a given device

Enumerator
INA_MODE_SHUTDOWN 

Device powered down.

INA_MODE_TRIGGERED_SHUNT 

Triggered shunt, no bus.

INA_MODE_TRIGGERED_BUS 

Triggered bus, no shunt.

INA_MODE_TRIGGERED_BOTH 

Triggered bus and shunt.

INA_MODE_POWER_DOWN 

shutdown or power-down

INA_MODE_CONTINUOUS_SHUNT 

Continuous shunt, no bus.

INA_MODE_CONTINUOUS_BUS 

Continuous bus, no shunt.

INA_MODE_CONTINUOUS_BOTH 

Both continuous, default value.

◆ ina_Type

enum ina_Type

Enumerated list detailing the names of all supported INA devices. The INA3221 is stored as 3 distinct devices each with their own enumerated type.