jimsynz / max1704x

Elixir driver for the MAX17040 and MAX17041 lithium battery monitoring ICs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Max1704x

Build Status Hex.pm Hippocratic License HL3-FULL

A library for interacting with the Analog Devices MAX17040 and MAX17041 1 and 2 cell lithium battery monitors over I2C.

Usage

This library uses the Wafer project connect to the I2C device which means that it is independent of any specific I2C driver.

Example using Elixir Circuits

iex> {:ok, conn} = Wafer.Driver.CircuitsI2C.acquire(bus: "i2c-1", address: 0x36)
...> {:ok, conn} = Max1704x.acquire(conn, 0)
...> Max1704x.current_voltage(conn)
{:ok, 4.165}

Installation

The max1704x package is available on hex so it can be installed by adding max1704x to your list of dependencies in mix.exs.

def deps do
  [
    {:max1704x, "~> 0.1.0"}
  ]
end

Documentation for the latest release is always available on HexDocs and for the main branch on docs.harton.nz.

Github Mirror

This repository is mirrored on Github from it's primary location on my Forgejo instance. Feel free to raise issues and open PRs on Github.

License

This software is licensed under the terms of the HL3-FULL, see the LICENSE.md file included with this package for the terms.

This license actively proscribes this software being used by and for some industries, countries and activities. If your usage of this software doesn't comply with the terms of this license, then contact me with the details of your use-case to organise the purchase of a license - the cost of which may include a donation to a suitable charity or NGO.

About

Elixir driver for the MAX17040 and MAX17041 lithium battery monitoring ICs

License:Other


Languages

Language:Elixir 100.0%