adafruit_max1704x

MAX17048 or MAX17049 battery fuel gauge library

  • Author(s): ladyada

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_max1704x.MAX17048(i2c_bus: I2C, address: int = 54)

Driver for the MAX1704X battery fuel gauge. :param ~busio.I2C i2c_bus: The I2C bus the MAX1704X is connected to. :param address: The I2C device address. Defaults to 0x36

property active_alert: bool

Whether there is an active alert to be checked

property activity_threshold: float

The absolute change in battery voltage that will trigger hibernation

property alert_reason: int

The 7 bits of alert-status that can be checked at once for flags

property cell_percent: float

The state of charge of the battery, in percentage of ‘fullness’

property cell_voltage: float

The state of charge of the battery, in volts

property charge_rate: float

Charge or discharge rate of the battery in percent/hour

hibernate() None

Setup thresholds for hibernation to go into hibernation mode immediately.

See datasheet: HIBRT Register (0x0A) To disable hibernate mode, set HIBRT = 0x0000. To always use hibernate mode, set HIBRT = 0xFFFF. Can check status with hibernating

property hibernation_threshold: float

The absolute-value percent-per-hour change in charge rate that will trigger hibernation

reset() None

Perform a soft reset of the chip

property reset_voltage: float

The voltage that will determine whether the chip will consider it a reset/swap

property voltage_alert_max: float

The upper-limit voltage for the voltage alert

property voltage_alert_min: float

The lower-limit voltage for the voltage alert

wake() None

Setup thresholds for hibernation to leave hibernation mode immediately.

See datasheet: HIBRT Register (0x0A) To disable hibernate mode, set HIBRT = 0x0000. To always use hibernate mode, set HIBRT = 0xFFFF. Can check status with hibernating