{"id":16064692,"url":"https://github.com/eldruin/pcf857x-rs","last_synced_at":"2025-03-18T05:30:47.702Z","repository":{"id":57653808,"uuid":"145333494","full_name":"eldruin/pcf857x-rs","owner":"eldruin","description":"Platform agnostic driver for the PCF8574, PCF8574A and PCF8575 I/O expanders written in Rust using embedded-hal","archived":false,"fork":false,"pushed_at":"2021-05-22T10:47:37.000Z","size":86,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-16T05:28:29.149Z","etag":null,"topics":["driver","embedded","embedded-hal","embedded-hal-driver","expander","i2c","io-expander","no-std","rust","rust-library"],"latest_commit_sha":null,"homepage":null,"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}},"created_at":"2018-08-19T19:58:21.000Z","updated_at":"2023-12-28T18:13:49.000Z","dependencies_parsed_at":"2022-08-26T07:12:00.750Z","dependency_job_id":null,"html_url":"https://github.com/eldruin/pcf857x-rs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fpcf857x-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fpcf857x-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fpcf857x-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fpcf857x-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldruin","download_url":"https://codeload.github.com/eldruin/pcf857x-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902832,"owners_count":20366360,"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","embedded-hal","embedded-hal-driver","expander","i2c","io-expander","no-std","rust","rust-library"],"created_at":"2024-10-09T05:09:09.610Z","updated_at":"2025-03-18T05:30:47.194Z","avatar_url":"https://github.com/eldruin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust PCF857x I/O Expanders Driver\n\n[![crates.io](https://img.shields.io/crates/v/pcf857x.svg)](https://crates.io/crates/pcf857x)\n[![Docs](https://docs.rs/pcf857x/badge.svg)](https://docs.rs/pcf857x)\n[![Build Status](https://github.com/eldruin/pcf857x-rs/workflows/Build/badge.svg)](https://github.com/eldruin/pcf857x-rs/actions?query=workflow%3ABuild)\n[![Coverage Status](https://coveralls.io/repos/github/eldruin/pcf857x-rs/badge.svg?branch=master)](https://coveralls.io/github/eldruin/pcf857x-rs?branch=master)\n\nThis is a platform agnostic Rust driver for the PCF8574, PCF8574A and PCF8575 I2C I/O expanders,\nbased on the [`embedded-hal`] traits.\n\nThis driver allows you to:\n- Set all the outputs to `0` or `1` at once. See `set()`.\n- Read selected inputs. See `get()`.\n- Set all the outputs repeatedly looping through an array. See `write_array()`.\n- Read selected inputs repeatedly filling up an array. See `read_array()`.\n- Split the device into individual input/output pins. See `split()`.\n\n## The devices\nThe devices consist of 8 or 16 quasi-bidirectional ports, I²C-bus interface, three\nhardware address inputs and interrupt output. The quasi-bidirectional port can be\nindependently assigned as an input to monitor interrupt status or keypads, or as an\noutput to activate indicator devices such as LEDs.\n\nThe active LOW open-drain interrupt output (INT) can be connected to the interrupt logic\nof the microcontroller and is activated when any input state differs from its corresponding\ninput port register state.\n\nDatasheets:\n- [PCF8574 / PCF8574A](https://www.nxp.com/docs/en/data-sheet/PCF8574_PCF8574A.pdf)\n- [PCF8575](https://www.nxp.com/documents/data_sheet/PCF8575.pdf)\n\n## Usage\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 pcf857x::{Pcf8574, PinFlag, SlaveAddr};\n\nfn main() {\n    let dev = I2cdev::new(\"/dev/i2c-1\").unwrap();\n    let address = SlaveAddr::default();\n    let mut expander = Pcf8574::new(dev, address);\n    let output_pin_status = 0b1010_1010;\n    expander.set(output_pin_status).unwrap();\n\n    let pins_to_be_read = PinFlag::P0 | PinFlag::P7;\n    let status = expander.get(pins_to_be_read).unwrap();\n\n    println!(\"Input pin status: {}\", status);\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/pcf857x-rs/issues).\n\n## License\n\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\n[`embedded-hal`]: https://github.com/rust-embedded/embedded-hal","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fpcf857x-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldruin%2Fpcf857x-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fpcf857x-rs/lists"}