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