Max1704x (max1704x v0.1.0)
MAX17040 AND MAX17041 Driver using Wafer.
Summary
Functions
Acquire a connection to the MAX1704x device using the passed-in I2C connection.
Returns the current version of the compensation value.
Set the value used to compensate the ModelGauge algorithm.
The current state-of-charge of the connected cell (in %).
The current voltage of the connected cell.
Asks the IC to perform a power-on-reset.
Asks the IC to perform a quick-start.
Returns the IC version.
Types
@type t() :: %Max1704x{conn: Wafer.Conn.t(), variant: term()}
variant()
@type variant() :: 0 | 1
Functions
acquire(conn, variant)
@spec acquire(Wafer.Conn.t(), variant()) :: {:ok, t()} | {:error, any()}
Acquire a connection to the MAX1704x device using the passed-in I2C connection.
The variant
option selects which IC to use (affects voltage scaling). Use
0
for MAX17040 and 1
for MAX17041.
compensation(conn)
Returns the current version of the compensation value.
compensation(conn, value)
@spec compensation(t(), 0..65535) :: {:ok, non_neg_integer()} | {:error, any()}
Set the value used to compensate the ModelGauge algorithm.
current_charge(conn)
The current state-of-charge of the connected cell (in %).
current_voltage(conn)
The current voltage of the connected cell.
power_on_reset!(conn)
Asks the IC to perform a power-on-reset.
See the Power-On Reset section of the data sheet.
quickstart!(conn)
Asks the IC to perform a quick-start.
See the Quick-Start section of the data sheet.
version(conn)
Returns the IC version.