stm32/gpio: Implement eh1::digital::InputPin
for OutputOpenDrain
Pins in open-drain mode are outputs and inputs simultaneously.
This commit is contained in:
parent
59f706ee2f
commit
c6513f93fe
1 changed files with 12 additions and 0 deletions
|
@ -974,6 +974,18 @@ mod eh1 {
|
||||||
type Error = Infallible;
|
type Error = Infallible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'d, T: Pin> InputPin for OutputOpenDrain<'d, T> {
|
||||||
|
#[inline]
|
||||||
|
fn is_high(&self) -> Result<bool, Self::Error> {
|
||||||
|
Ok(self.is_high())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn is_low(&self) -> Result<bool, Self::Error> {
|
||||||
|
Ok(self.is_low())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'d, T: Pin> OutputPin for OutputOpenDrain<'d, T> {
|
impl<'d, T: Pin> OutputPin for OutputOpenDrain<'d, T> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn set_high(&mut self) -> Result<(), Self::Error> {
|
fn set_high(&mut self) -> Result<(), Self::Error> {
|
||||||
|
|
Loading…
Reference in a new issue