diff options
| author | xoviat <[email protected]> | 2023-10-04 17:36:26 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-04 17:36:26 +0000 |
| commit | b887b7516ebdb007b9e691e88e88156fad660b44 (patch) | |
| tree | 2742a587399368de2dc3e91222a488cabd25aac5 | |
| parent | 59f706ee2f93252d1c040cea149dfd744f4d8c16 (diff) | |
| parent | c6513f93fe8198cfcb49adc9d8b61e27090578fc (diff) | |
Merge pull request #2011 from glaeqen/input-pin
stm32/gpio: Implement `eh1::digital::InputPin` for `OutputOpenDrain`
| -rw-r--r-- | embassy-stm32/src/gpio.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/embassy-stm32/src/gpio.rs b/embassy-stm32/src/gpio.rs index c709d46da..58d17f12e 100644 --- a/embassy-stm32/src/gpio.rs +++ b/embassy-stm32/src/gpio.rs | |||
| @@ -974,6 +974,18 @@ mod eh1 { | |||
| 974 | type Error = Infallible; | 974 | type Error = Infallible; |
| 975 | } | 975 | } |
| 976 | 976 | ||
| 977 | impl<'d, T: Pin> InputPin for OutputOpenDrain<'d, T> { | ||
| 978 | #[inline] | ||
| 979 | fn is_high(&self) -> Result<bool, Self::Error> { | ||
| 980 | Ok(self.is_high()) | ||
| 981 | } | ||
| 982 | |||
| 983 | #[inline] | ||
| 984 | fn is_low(&self) -> Result<bool, Self::Error> { | ||
| 985 | Ok(self.is_low()) | ||
| 986 | } | ||
| 987 | } | ||
| 988 | |||
| 977 | impl<'d, T: Pin> OutputPin for OutputOpenDrain<'d, T> { | 989 | impl<'d, T: Pin> OutputPin for OutputOpenDrain<'d, T> { |
| 978 | #[inline] | 990 | #[inline] |
| 979 | fn set_high(&mut self) -> Result<(), Self::Error> { | 991 | fn set_high(&mut self) -> Result<(), Self::Error> { |
