Change pins in qei.rs example #757
-
|
My purpose is to use both 32 bits timers (TIM2 and TIM5) as encoders. I cannot find a combination of pins that compiles. When compiling the qei.rs example, there's no error.
Now, if I change : to : I get this error : Does it mean the channels must belong to the same port ? PB3 is a legal choice for TIM2_CH2 (cf Table 9. Alternate function mapping in the reference manual). The error messages don't help me very much. Thanks for your attention. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The issue with let rotary_encoder_pins = (gpioa.pa0, gpiob.pb3.into_alternate());This is because |
Beta Was this translation helpful? Give feedback.
The issue with
PB3it is already inAlternateMode, but different then needed. Configured for JTAG.This is because
Fromtrait is not implemented for conversion between alternate modes due to conflict with implementation ofFrom<Self>.Alternative solution is to use custom trait instead of
From.