{"id":16015022,"url":"https://github.com/kiranshila/pac194x","last_synced_at":"2025-07-04T13:33:50.964Z","repository":{"id":57651736,"uuid":"474179096","full_name":"kiranshila/pac194x","owner":"kiranshila","description":" Platform-agnostic Rust driver for the PAC194x 9V, 16-bit power monitor with alerts","archived":false,"fork":false,"pushed_at":"2022-04-11T00:15:35.000Z","size":76,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T20:36:29.661Z","etag":null,"topics":["driver","embedded-hal","embedded-hal-driver","i2c","power","power-monitor","power-monitoring","rust","rust-embedded"],"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/kiranshila.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-25T22:19:36.000Z","updated_at":"2023-11-25T21:48:20.000Z","dependencies_parsed_at":"2022-08-28T02:22:02.387Z","dependency_job_id":null,"html_url":"https://github.com/kiranshila/pac194x","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/kiranshila/pac194x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranshila%2Fpac194x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranshila%2Fpac194x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranshila%2Fpac194x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranshila%2Fpac194x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiranshila","download_url":"https://codeload.github.com/kiranshila/pac194x/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranshila%2Fpac194x/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261244155,"owners_count":23129663,"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":["driver","embedded-hal","embedded-hal-driver","i2c","power","power-monitor","power-monitoring","rust","rust-embedded"],"created_at":"2024-10-08T15:05:55.463Z","updated_at":"2025-07-04T13:33:50.943Z","avatar_url":"https://github.com/kiranshila.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust PAC194X Power Monitor Driver\n\nA platform-agnostic driver crate for the Microchip [PAC194X](https://ww1.microchip.com/downloads/en/DeviceDoc/PAC194X-Data-Sheet-20006543.pdf) single/multi channel power monitor using the embedded-hal traits.\n\n[![Build Status](https://github.com/kiranshila/pac194x/workflows/Main/badge.svg)](https://github.com/kiranshila/pac194x/actions)\n[![Docs.rs](https://docs.rs/pac194x/badge.svg)](https://docs.rs/pac194x)\n[![Crates.io](https://img.shields.io/crates/v/pac194x)](https://crates.io/crates/pac194x)\n\nThis driver allows you to:\n- Read/Write every available register as a Rust data structure, allowing you to configure alerts, averaging, etc.\n- Read the bus and sense voltages directly as `f32`s\n\n\u003c!-- TODO\n[Introductory blog post]()\n--\u003e\n\n## Usage\n\nTo use this driver, import this crate and an `embedded_hal` implementation,\nthen instantiate the appropriate device.\n\n```rust\nuse linux_embedded_hal::I2cdev;\nuse pac194x::{PAC194X, AddrSelect};\n\nconst SENSE_RESISTOR: f32 = 0.5;\n\nfn main() {\n    let i2c = I2cdev::new(\"/dev/i2c-1\").unwrap();\n    let mut sensor = PAC194X::new(i2c, AddrSelect::GND).unwrap();\n    loop {\n        let bus_voltage_1 = sensor.read_bus_voltage_n(1).unwrap();\n        let sense_voltage_1 = sensor.read_sense_voltage_n(1).unwrap();\n        println!(\"Channel 1 has a bus voltage of: {:.2} V\", bus_voltage_1);\n        println!(\"Channel 1 is pulling a current of: {:.2} A\", sense_voltage_1 / SENSE_RESISTOR);\n    }\n}\n```\n\n## Discussion\n\nI wrote a blog post about the development of this crate [here](https://blog.kiranshila.com/blog/pac_rust_driver.md)\n\n## License\nLicensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiranshila%2Fpac194x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiranshila%2Fpac194x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiranshila%2Fpac194x/lists"}