1use core::fmt;
4
5use embedded_hal::digital::blocking::OutputPin;
6use embedded_hal::digital::ErrorType;
7use embedded_hal_stable::digital::v2::OutputPin as StableOutputPin;
8
9pub struct Pin<T>(pub T);
16
17impl<T> ErrorType for Pin<T> where T: StableOutputPin, T::Error: fmt::Debug { type Error = T::Error; }
18
19impl<T> OutputPin for Pin<T>
20where
21 T: StableOutputPin,
22 T::Error: fmt::Debug,
23{
24 fn set_low(&mut self) -> Result<(), Self::Error> {
25 self.0.set_low()
26 }
27
28 fn set_high(&mut self) -> Result<(), Self::Error> {
29 self.0.set_high()
30 }
31}