Merge pull request #2716 from embassy-rs/stm32-opendrain-eh02-input

stm32/gpio: add missing eh02 InputPin for OutputOpenDrain.
This commit is contained in:
Dario Nieuwenhuis 2024-03-20 12:55:52 +00:00 committed by GitHub
commit 23740abdca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -833,6 +833,18 @@ impl<'d> embedded_hal_02::digital::v2::ToggleableOutputPin for Output<'d> {
} }
} }
impl<'d> embedded_hal_02::digital::v2::InputPin for OutputOpenDrain<'d> {
type Error = Infallible;
fn is_high(&self) -> Result<bool, Self::Error> {
Ok(self.is_high())
}
fn is_low(&self) -> Result<bool, Self::Error> {
Ok(self.is_low())
}
}
impl<'d> embedded_hal_02::digital::v2::OutputPin for OutputOpenDrain<'d> { impl<'d> embedded_hal_02::digital::v2::OutputPin for OutputOpenDrain<'d> {
type Error = Infallible; type Error = Infallible;