From 54c0759cbd458d11ad20ca23105998514a6c86fe Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Tue, 26 Jul 2022 15:01:45 +0200 Subject: [PATCH] Remove IoPin. --- CHANGELOG.md | 3 +++ src/digital.rs | 46 ---------------------------------------------- 2 files changed, 3 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 063f27b51..fe8c48c10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Fixed documentation for `wait_for_rising_edge`. +### Removed +- `digital::blocking::IoPin` traits. + ## [v1.0.0-alpha.8] - 2022-04-15 *** This is (also) an alpha release with breaking changes (sorry) *** diff --git a/src/digital.rs b/src/digital.rs index b063d4f75..b0d67768b 100644 --- a/src/digital.rs +++ b/src/digital.rs @@ -152,50 +152,4 @@ pub mod blocking { T::is_low(self) } } - - /// Single pin that can switch from input to output mode, and vice-versa. - /// - /// Example use (assumes the `Error` type is the same for the `IoPin`, - /// `InputPin`, and `OutputPin`): - /// - /// ``` - /// use core::time::Duration; - /// use embedded_hal::digital::blocking::{IoPin, InputPin, OutputPin}; - /// - /// pub fn ping_and_read( - /// mut pin: TOutputPin, delay_fn: &dyn Fn(Duration) -> ()) -> Result - /// where - /// TInputPin : InputPin + IoPin, - /// TOutputPin : OutputPin + IoPin, - /// { - /// // Ping - /// pin.set_low()?; - /// delay_fn(Duration::from_millis(10)); - /// pin.set_high()?; - /// - /// // Read - /// let pin = pin.into_input_pin()?; - /// delay_fn(Duration::from_millis(10)); - /// pin.is_high() - /// } - /// ``` - pub trait IoPin - where - TInput: InputPin + IoPin, - TOutput: OutputPin + IoPin, - { - /// Error type. - type Error: core::fmt::Debug; - - /// Tries to convert this pin to input mode. - /// - /// If the pin is already in input mode, this method should succeed. - fn into_input_pin(self) -> Result; - - /// Tries to convert this pin to output mode with the given initial state. - /// - /// If the pin is already in the requested state, this method should - /// succeed. - fn into_output_pin(self, state: PinState) -> Result; - } }