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

@type options() :: [conn: term(), variant: term()]
@type t() :: %Max1704x{conn: Wafer.Conn.t(), variant: :max17040 | :max17041}

Functions

Link to this function

acquire(options)

@spec acquire(options()) :: {:ok, t()} | {:error, any()}

Acquire a connection to the MAX1704x device using the passed-in I2C connection.

Link to this function

compensation(conn)

@spec compensation(t()) :: {:ok, 0..65535} | {:error, any()}

Returns the current version of the compensation value.

Link to this function

compensation(conn, value)

@spec compensation(t(), 0..65535) :: {:ok, non_neg_integer()} | {:error, any()}

Set the value used to compensate the ModelGauge algorithm.

Link to this function

current_charge(conn)

@spec current_charge(t()) :: {:ok, float()} | {:error, any()}

The current state-of-charge of the connected cell (in %).

Link to this function

current_voltage(max1704x)

@spec current_voltage(t()) :: {:ok, float()} | {:error, any()}

The current voltage of the connected cell.

Link to this function

power_on_reset!(conn)

@spec power_on_reset!(t()) :: {:ok, t()} | {:error, any()}

Asks the IC to perform a power-on-reset.

See the Power-On Reset section of the data sheet.

Link to this function

quickstart!(conn)

@spec quickstart!(t()) :: {:ok, t()} | {:error, any()}

Asks the IC to perform a quick-start.

See the Quick-Start section of the data sheet.

@spec version(t()) :: {:ok, 0..15} | {:error, any()}

Returns the IC version.