Inverted Input/Output Pin Implementations
This provides implementations of the input/output pin embedded-hal traits with inverted logic.
For example, an InvertedPin can wrap an OutputPin and when setting it low, it will set the
wrapped OutputPin high. It works similarly for an InputPin as well.
This is useful when dealing with pins that use a logic that is inverted with respect to what the rest of the system expects.
Since an InvertedPin implements the OutputPin and InputPin traits as well, it can be used
just like any other OutputPin or InputPin and serves as a drop-in replacement of the wrapped pin.
Usage
This example demonstrates how the same driver can operate with either a normal or an inverted output pin.
use OutputPin;
use InvertedPin;
use SysfsPin;
Support
For questions, issues, feature requests, and other changes, please file an issue in the github project.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributing
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.