diff --git a/examples/comp.rs b/examples/comp.rs index 5893e6d0..ec5d078c 100644 --- a/examples/comp.rs +++ b/examples/comp.rs @@ -46,7 +46,7 @@ fn main() -> ! { .output_inverted(), &rcc.clocks, ); - let led2 = gpioa.pa12.into_push_pull_output(); + let led2 = gpioa.pa12.into_alternate(); // Configure PA12 to the comparator's alternate function so it gets // changed directly by the comparator. comp2.output_pin(led2); diff --git a/examples/comp_w_dac.rs b/examples/comp_w_dac.rs index 20600068..e1313108 100644 --- a/examples/comp_w_dac.rs +++ b/examples/comp_w_dac.rs @@ -43,7 +43,7 @@ fn main() -> ! { &rcc.clocks, ); - let led2 = gpioa.pa0.into_push_pull_output(); + let led2 = gpioa.pa0.into_alternate(); // Configure PA12 to the comparator's alternate function so it gets // changed directly by the comparator. comp.output_pin(led2); diff --git a/src/gpio.rs b/src/gpio.rs index 08966073..d84230bb 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -353,43 +353,43 @@ macro_rules! gpio { } #[allow(clippy::from_over_into)] - impl Into<$PXi, F>> for $PXi { - fn into(self) -> $PXi, F> { + impl Into<$PXi>> for $PXi { + fn into(self) -> $PXi> { self.into_pull_down_input() } } #[allow(clippy::from_over_into)] - impl Into<$PXi, F>> for $PXi { - fn into(self) -> $PXi, F> { + impl Into<$PXi>> for $PXi { + fn into(self) -> $PXi> { self.into_pull_up_input() } } #[allow(clippy::from_over_into)] - impl Into<$PXi> for $PXi { - fn into(self) -> $PXi { + impl Into<$PXi> for $PXi { + fn into(self) -> $PXi { self.into_analog() } } #[allow(clippy::from_over_into)] - impl Into<$PXi, F>> for $PXi { - fn into(self) -> $PXi, F> { + impl Into<$PXi>> for $PXi { + fn into(self) -> $PXi> { self.into_open_drain_output() } } #[allow(clippy::from_over_into)] - impl Into<$PXi, F>> for $PXi { - fn into(self) -> $PXi, F> { + impl Into<$PXi>> for $PXi { + fn into(self) -> $PXi> { self.into_push_pull_output() } } impl $PXi { /// Configures the pin to operate as a floating input pin - pub fn into_floating_input(self) -> $PXi, F> { + pub fn into_floating_input(self) -> $PXi> { let offset = 2 * $i; unsafe { let gpio = &(*$GPIOX::ptr()); @@ -404,7 +404,7 @@ macro_rules! gpio { } /// Configures the pin to operate as a pulled down input pin - pub fn into_pull_down_input(self) -> $PXi, F> { + pub fn into_pull_down_input(self) -> $PXi> { let offset = 2 * $i; unsafe { let gpio = &(*$GPIOX::ptr()); @@ -419,7 +419,7 @@ macro_rules! gpio { } /// Configures the pin to operate as a pulled up input pin - pub fn into_pull_up_input(self) -> $PXi, F> { + pub fn into_pull_up_input(self) -> $PXi> { let offset = 2 * $i; unsafe { let gpio = &(*$GPIOX::ptr()); @@ -449,7 +449,7 @@ macro_rules! gpio { } /// Configures the pin to operate as an open drain output pin - pub fn into_open_drain_output(self) -> $PXi, F> { + pub fn into_open_drain_output(self) -> $PXi> { let offset = 2 * $i; unsafe { let gpio = &(*$GPIOX::ptr()); @@ -467,7 +467,7 @@ macro_rules! gpio { } /// Configures the pin to operate as an push pull output pin - pub fn into_push_pull_output(self) -> $PXi, F> { + pub fn into_push_pull_output(self) -> $PXi> { let offset = 2 * $i; unsafe { let gpio = &(*$GPIOX::ptr()); @@ -485,7 +485,7 @@ macro_rules! gpio { } /// Configures the pin as external trigger - pub fn listen(self, edge: SignalEdge, exti: &mut EXTI) -> $PXi, F> { + pub fn listen(self, edge: SignalEdge, exti: &mut EXTI) -> $PXi> { let offset = 2 * $i; unsafe { let gpio = &(*$GPIOX::ptr());