adafruit_ina3221
CircuitPython driver for the INA3221 Triple 0-26 VDC, ±3.2 Amp Power Monitor
Author(s): Liz Clark
Implementation Notes
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_ina3221.AVG_MODE
Enumeration for the averaging mode options in INA3221.
- class adafruit_ina3221.CONV_TIME
Enumeration for conversion time options in INA3221.
- class adafruit_ina3221.INA3221(i2c, address: int = DEFAULT_ADDRESS, enable: List = [0, 1, 2], probe: bool = True)
Driver for the INA3221 device with three channels.
Initializes the INA3221 class over I2C :param i2c: The I2C bus to which the INA3221 is connected. :type i2c: I2C :param address: The I2C address of the INA3221. Defaults to DEFAULT_ADDRESS. :type address: int, optional :param enable: channels to initialize at start (default: all) :type enable: List[int], optional :param probe: Probe for the device upon object creation, default is true :type probe: bool, optional
- property averaging_mode: int
Averaging mode.
- Returns:
The current averaging mode (0-7). 0: 1 SAMPLE, 1: 4_SAMPLES, 2: 16_SAMPLES, 3: 64_SAMPLES, 4: 128_SAMPLES, 5: 256_SAMPLES, 6: 512_SAMPLES, 7: 1024_SAMPLES
- Return type:
- property bus_voltage_conv_time: int
Bus voltage conversion time.
- Returns:
The current bus voltage conversion time (0-7). 0: 140µs, 1: 204µs, 2: 332µs, 3: 588µs, 4: 1ms, 5: 2ms, 6: 4ms, 7: 8ms
- Return type:
- property flags: int
Flag indicators from the Mask/Enable register.
- Returns:
The current flag indicators from the Mask/Enable register, masked for relevant flag bits.
- Return type:
- property manufacturer_id: int
Manufacturer ID of the INA3221.
- Returns:
The Manufacturer ID in integer format.
- Return type:
- property mode: int
Operating mode of the INA3221.
- Returns:
The current mode value. 0: Power down mode, 1: Trigger shunt voltage measurement, 2: Trigger bus voltage measurement, 3: Trigger both shunt and bus voltage measurements, 4: Alternate power down mode, 5: Continuous shunt voltage measurement, 6: Continuous bus voltage measurement, 7: Continuous shunt and bus voltage measurements
- Return type:
- class adafruit_ina3221.INA3221Channel(device: Any, channel: int)
Represents a single channel of the INA3221.
- Parameters:
device (Any) – The device INA3221 instance managing the I2C communication.
channel (int) – The channel number (1, 2, or 3) for this instance.
- property critical_alert_threshold: float
Critical-Alert threshold in amperes
- Returns:
The current critical alert threshold in amperes.
- Return type:
- class adafruit_ina3221.MODE
Enumeration for operating modes in INA3221.