diff --git a/CHANGELOG.md b/CHANGELOG.md index a491cce5..42c5a602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Breaking changes - Change timer/pwm init API +- Remove `set_low` and `set_high` for pins in Alternate output mode ### Changed diff --git a/src/gpio.rs b/src/gpio.rs index 9519a23e..10e35a40 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -479,30 +479,6 @@ macro_rules! gpio { impl toggleable::Default for $PXi> {} - impl OutputPin for $PXi> { - type Error = Void; - fn set_high(&mut self) -> Result<(), Self::Error> { - // NOTE(unsafe) atomic write to a stateless register - Ok(unsafe { (*$GPIOX::ptr()).bsrr.write(|w| w.bits(1 << $i)) }) - } - - fn set_low(&mut self) -> Result<(), Self::Error> { - // NOTE(unsafe) atomic write to a stateless register - Ok(unsafe { (*$GPIOX::ptr()).bsrr.write(|w| w.bits(1 << (16 + $i))) }) - } - } - - impl StatefulOutputPin for $PXi> { - fn is_set_high(&self) -> Result { - self.is_set_low().map(|b| !b) - } - - fn is_set_low(&self) -> Result { - // NOTE(unsafe) atomic read with no side effects - Ok(unsafe { (*$GPIOX::ptr()).odr.read().bits() & (1 << $i) == 0 }) - } - } - impl InputPin for $PXi> { type Error = Void; fn is_high(&self) -> Result {