{"id":16064693,"url":"https://github.com/eldruin/max170xx-rs","last_synced_at":"2025-03-16T08:32:08.828Z","repository":{"id":57637094,"uuid":"256723390","full_name":"eldruin/max170xx-rs","owner":"eldruin","description":"Platform-agnostic Rust driver for the MAX170xx 1-cell/2-cell fuel-gauge systems with ModelGauge for lithium-ion (Li+) batteries. Compatible with MAX17043, MAX17044, MAX17048, MAX17049, MAX17058 and MAX17059.","archived":false,"fork":false,"pushed_at":"2024-04-29T06:52:24.000Z","size":60,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-16T05:28:29.637Z","etag":null,"topics":["battery","battery-cell","battery-monitor","driver","embedded-hal-driver","fuel-gauge","i2c","lithium-battery-monitor","no-std","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eldruin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-18T10:18:48.000Z","updated_at":"2024-04-29T06:52:27.000Z","dependencies_parsed_at":"2024-10-27T10:12:30.800Z","dependency_job_id":"600ef6af-f08b-48ff-bfd6-16efb35c5a13","html_url":"https://github.com/eldruin/max170xx-rs","commit_stats":{"total_commits":45,"total_committers":3,"mean_commits":15.0,"dds":0.0444444444444444,"last_synced_commit":"11c92db90e4598982307a9e1e18f83fc4e54d0dd"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fmax170xx-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fmax170xx-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fmax170xx-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fmax170xx-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldruin","download_url":"https://codeload.github.com/eldruin/max170xx-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806070,"owners_count":20350775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["battery","battery-cell","battery-monitor","driver","embedded-hal-driver","fuel-gauge","i2c","lithium-battery-monitor","no-std","rust"],"created_at":"2024-10-09T05:09:10.197Z","updated_at":"2025-03-16T08:32:08.179Z","avatar_url":"https://github.com/eldruin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust MAX170xx 1-Cell/2-Cell Fuel Gauge for Lithium-ion (Li+) Batteries Driver\n\n[![crates.io](https://img.shields.io/crates/v/max170xx.svg)](https://crates.io/crates/max170xx)\n[![Docs](https://docs.rs/max170xx/badge.svg)](https://docs.rs/max170xx)\n[![Build Status](https://github.com/eldruin/max170xx-rs/workflows/Build/badge.svg)](https://github.com/eldruin/max170xx-rs/actions?query=workflow%3ABuild)\n[![Coverage Status](https://coveralls.io/repos/github/eldruin/max170xx-rs/badge.svg?branch=master)](https://coveralls.io/github/eldruin/max170xx-rs?branch=master)\n![Minimum Supported Rust Version](https://img.shields.io/badge/rustc-1.62+-blue.svg)\n\nThis is a platform agnostic Rust driver for the ultra-compact, low-cost,\nhost-side fuel-gauge systems for lithium-ion (Li+) batteries in handheld\nand portable equipment using the [`embedded-hal`] traits.\n\nIt is compatible with MAX17043, MAX17044, MAX17048, MAX17049, MAX17058 and MAX17059.\n\nThis driver allows you to:\n- Get state of charge. See: `soc()`.\n- Get battery voltage. See: `voltage()`.\n- Software reset. See: `reset()`.\n- Quickstart. See: `quickstart()`.\n- Get IC version. See: `version()`.\n- Only on MAX17048/MAX17049:\n    - Get charge/discharge rate. See: `charge_rate()`.\n- Only on MAX17048/MAX17049/MAX17058/MAX17059:\n    - Set table registers. See: `set_table()`.\n\n\u003c!-- TODO\n[Introductory blog post]()\n--\u003e\n\n## The devices\nThe devices are ultra-compact, low-cost, host-side fuel-gauge systems\nfor lithium-ion (Li+) batteries in handheld and portable equipment.\nThere are models configured to operate with a single or dual lithium\ncell pack.\n\nThe devices use a sophisticated Li+ battery-modeling scheme, called\nModelGauge(TM) to track the battery's relative state-of-charge (SOC)\ncontinuously over a widely varying charge/discharge profile. Unlike\ntraditional fuel gauges, the ModelGauge algorithm eliminates the need\nfor battery relearn cycles and an external current-sense resistor.\nTemperature compensation is possible in the application with minimal\ninteraction between a μC and the device.\n\nThe communication is done through an I2C interface.\n\nDatasheets: [MAX17043/MAX17044](https://datasheets.maximintegrated.com/en/ds/MAX17043-MAX17044.pdf),\n[MAX17048/MAX17049](https://datasheets.maximintegrated.com/en/ds/MAX17048-MAX17049.pdf),\n[MAX17058/MAX17059](https://datasheets.maximintegrated.com/en/ds/MAX17058-MAX17059.pdf)\n\n## Usage\n\nTo use this driver, import this crate and an `embedded_hal` implementation,\nthen instantiate the device.\n\nPlease find additional examples using hardware in this repository: [driver-examples]\n\n[driver-examples]: https://github.com/eldruin/driver-examples\n\n```rust\nuse linux_embedded_hal::I2cdev;\nuse max170xx::Max17043;\n\nfn main() {\n    let dev = I2cdev::new(\"/dev/i2c-1\").unwrap();\n    let mut sensor = Max17043::new(dev);\n    loop {\n        let soc = sensor.soc().unwrap();\n        let voltage = sensor.voltage().unwrap();\n        println!(\"Charge: {:.2}%\", soc);\n        println!(\"Voltage: {:.2}V\", voltage);\n    }\n}\n```\n\n## Support\n\nFor questions, issues, feature requests, and other changes, please file an\n[issue in the github project](https://github.com/eldruin/max170xx-rs/issues).\n\n## Minimum Supported Rust Version (MSRV)\n\nThis crate is guaranteed to compile on stable Rust 1.62 and up. It *might*\ncompile with older versions but that may change in any new patch release.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n   \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contributing\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\n[`embedded-hal`]: https://github.com/rust-embedded/embedded-hal\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fmax170xx-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldruin%2Fmax170xx-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fmax170xx-rs/lists"}