Skip to content

Commit d5cdf33

Browse files
bors[bot]Dirbaio
andauthored
Merge #393
393: Remove IoPin r=eldruin a=Dirbaio As discussed in #340 it's unclear if the current IoPin trait is the best way to go (tldr: due to the fact it changes type it's hard to own it in driver structs). I propose temporarily removing it, to unblock the 1.0 release. When discussion settles on a final design, we can add it back. Co-authored-by: Dario Nieuwenhuis <[email protected]>
2 parents 8cf26d5 + 54c0759 commit d5cdf33

File tree

2 files changed

+3
-46
lines changed

2 files changed

+3
-46
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313
### Fixed
1414
- Fixed documentation for `wait_for_rising_edge`.
1515

16+
### Removed
17+
- `digital::blocking::IoPin` traits.
18+
1619
## [v1.0.0-alpha.8] - 2022-04-15
1720

1821
*** This is (also) an alpha release with breaking changes (sorry) ***

src/digital.rs

-46
Original file line numberDiff line numberDiff line change
@@ -152,50 +152,4 @@ pub mod blocking {
152152
T::is_low(self)
153153
}
154154
}
155-
156-
/// Single pin that can switch from input to output mode, and vice-versa.
157-
///
158-
/// Example use (assumes the `Error` type is the same for the `IoPin`,
159-
/// `InputPin`, and `OutputPin`):
160-
///
161-
/// ```
162-
/// use core::time::Duration;
163-
/// use embedded_hal::digital::blocking::{IoPin, InputPin, OutputPin};
164-
///
165-
/// pub fn ping_and_read<TInputPin, TOutputPin, TError: core::fmt::Debug>(
166-
/// mut pin: TOutputPin, delay_fn: &dyn Fn(Duration) -> ()) -> Result<bool, TError>
167-
/// where
168-
/// TInputPin : InputPin<Error = TError> + IoPin<TInputPin, TOutputPin, Error = TError>,
169-
/// TOutputPin : OutputPin<Error = TError> + IoPin<TInputPin, TOutputPin, Error = TError>,
170-
/// {
171-
/// // Ping
172-
/// pin.set_low()?;
173-
/// delay_fn(Duration::from_millis(10));
174-
/// pin.set_high()?;
175-
///
176-
/// // Read
177-
/// let pin = pin.into_input_pin()?;
178-
/// delay_fn(Duration::from_millis(10));
179-
/// pin.is_high()
180-
/// }
181-
/// ```
182-
pub trait IoPin<TInput, TOutput>
183-
where
184-
TInput: InputPin + IoPin<TInput, TOutput>,
185-
TOutput: OutputPin + IoPin<TInput, TOutput>,
186-
{
187-
/// Error type.
188-
type Error: core::fmt::Debug;
189-
190-
/// Tries to convert this pin to input mode.
191-
///
192-
/// If the pin is already in input mode, this method should succeed.
193-
fn into_input_pin(self) -> Result<TInput, Self::Error>;
194-
195-
/// Tries to convert this pin to output mode with the given initial state.
196-
///
197-
/// If the pin is already in the requested state, this method should
198-
/// succeed.
199-
fn into_output_pin(self, state: PinState) -> Result<TOutput, Self::Error>;
200-
}
201155
}

0 commit comments

Comments
 (0)