Max1704x (max1704x v0.1.1)
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
options()
@type t() :: %Max1704x{conn: Wafer.Conn.t(), variant: :max17040 | :max17041}
Functions
acquire(options)
Acquire a connection to the MAX1704x device using the passed-in I2C connection.
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(max1704x)
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.