barbudor_INA3221.full - Full version library

CircuitPython driver for the Texas Instruments INA3221 3 channels current sensor

Author : Barbudor (Jean-Michel Mercier)

Implementation Notes

In order to be coherent with the datasheet, the channel index in the below API start at 1. Value of channel parameter must be 1, 2 or 3. Do not use 0

Memory usage:

Tested with CircuitPython 4.0.0-rc.1 on CircuitPlayground Express:

  • from barbudor_ina3221 import INA3221 => 6704 bytes
  • ina3221 = INA3221(i2c_bus) => 112 bytes

Hardware:

  • Device: INA3221 Triple, Low-/High-Side, I2C Out Current/Voltage Monitor.

Software and Dependencies:

class barbudor_ina3221.full.INA3221(i2c_bus, i2c_addr=64, shunt_resistor=(0.1, 0.1, 0.1))[source]

Driver class for Texas Instruments INA3221 3 channel current sensor device

bus_voltage(channel=1)[source]

Returns the channel’s bus voltage in Volts

current(channel=1)[source]

Return’s the channel current in Amps

enable_channel(channel=1, enable=True)[source]

Enables or disable a given channel

is_channel_enabled(channel=1)[source]

Returns if a given channel is enabled or not

is_ready

Returns the CVRF (ConVersion Ready Flag) from the mask/enable register

read(reg)[source]

Return value from device register

set_shunt_critical_alert_limit(channel, voltage)[source]

Sets the channel’s shunt voltage critical alert limit in Volts

set_shunt_warning_alert_limit(channel, voltage)[source]

Sets the channel’s shunt voltage warning alert limit in Volts

shunt_critical_alert_limit(channel=1)[source]

Returns the channel’s shunt voltage critical alert limit in Volts

shunt_voltage(channel=1)[source]

Returns the channel’s shunt voltage in Volts

shunt_warning_alert_limit(channel=1)[source]

Returns the channel’s shunt voltage warning alert limit in Volts

update(reg, mask, value)[source]

Read-modify-write value in register

write(reg, value)[source]

Write value in device register

barbudor_INA3221.lite - Lite version library

CircuitPython driver for the Texas Instruments INA3221 3 channels current sensor

Author : Barbudor (Jean-Michel Mercier)

Implementation Notes

In order to be coherent with the datasheet, the channel index in the below API start at 1. Value of channel parameter must be 1, 2 or 3. Do not use 0

Memory usage:

Tested with CircuitPython 4.0.0-rc.1 on CircuitPlayground Express:

  • from barbudor_ina3221 import INA3221 => 3200 bytes
  • ina3221 = INA3221(i2c_bus) => 112 bytes

Hardware:

  • Device: INA3221 Triple, Low-/High-Side, I2C Out Current/Voltage Monitor.

Software and Dependencies:

class barbudor_ina3221.lite.INA3221(i2c_bus, i2c_addr=64, shunt_resistor=(0.1, 0.1, 0.1))[source]

Driver class for Texas Instruments INA3221 3 channel current sensor device

bus_voltage(channel=1)[source]

Returns the channel’s bus voltage in Volts

current(channel=1)[source]

Return’s the channel current in Amps

enable_channel(channel=1, enable=True)[source]

Enables or disable a given channel

is_channel_enabled(channel=1)[source]

Returns if a given channel is enabled or not

read(reg)[source]

Return value from device register

shunt_voltage(channel=1)[source]

Returns the channel’s shunt voltage in Volts

update(reg, mask, value)[source]

Read-modify-write value in register

write(reg, value)[source]

Write value in device register