I want to set alternate mode for AP10 of stm32f411 by rust HAl. My code looks like this:
let rx_pin = gpioa.pa10.into_alternate();
But it has multiple impl:
= note: multiple `impl`s satisfying `stm32f4xx_hal::gpio::Pin<'A', 10>: gpio::marker::IntoAf<_>` found in the `stm32f4xx_hal` crate:
- impl<MODE> gpio::marker::IntoAf<10> for stm32f4xx_hal::gpio::Pin<'A', 10, MODE>;
- impl<MODE> gpio::marker::IntoAf<1> for stm32f4xx_hal::gpio::Pin<'A', 10, MODE>;
- impl<MODE> gpio::marker::IntoAf<6> for stm32f4xx_hal::gpio::Pin<'A', 10, MODE>;
- impl<MODE> gpio::marker::IntoAf<7> for stm32f4xx_hal::gpio::Pin<'A', 10, MODE>;
How can I fix this compile error?
Fixex by specifying a value for generic
Because the prototype of the method of into_alternate looks like this:
And I need the alternate mode 7 for the pin.
This question sounds silly, but hope it will help someone still a absolute newbie crustacean (like me) in the future.