# Inverted Input/Output Pin Implementations [![crates.io](https://img.shields.io/crates/v/inverted-pin.svg)](https://crates.io/crates/inverted-pin) [![Docs](https://docs.rs/inverted-pin/badge.svg)](https://docs.rs/inverted-pin) ![MSRV](https://img.shields.io/badge/rustc-1.60+-blue.svg) [![Build Status](https://github.com/eldruin/inverted-pin-rs/workflows/Build/badge.svg)](https://github.com/eldruin/inverted-pin-rs/actions?query=workflow%3ABuild) [![Coverage Status](https://coveralls.io/repos/github/eldruin/inverted-pin-rs/badge.svg?branch=master)](https://coveralls.io/github/eldruin/inverted-pin-rs?branch=master) 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. ```rust use embedded_hal::digital::OutputPin; use inverted_pin::InvertedPin; use linux_embedded_hal::SysfsPin; struct Driver
{ output: P, } impl
Driver
where
P: OutputPin