Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to map different alt functions on the same pad to a TimerPin #3

Open
boondocklabs opened this issue Oct 15, 2023 · 0 comments
Open

Comments

@boondocklabs
Copy link

boondocklabs commented Oct 15, 2023

I have added some additional pin mappings for timer outputs in #2, however there was an issue mapping them all, as it results in a conflicting trait implementation for a pad that has multiple alternate functions mapping to different channels of the timer.

For example on the STM32C011, PB6 can be either TIM1 Channel2 on AF11 or Channel3 on AF1, so we can't do:

timer_pins!(TIM1, [
    (Channel2, PB6<DefaultMode>, AltFunction::AF11),
    (Channel3, PB6<DefaultMode>, AltFunction::AF1),
]);

which results in

error[E0119]: conflicting implementations of trait `TimerPin<stm32c0::stm32c031::TIM1>` for type `gpio::gpiob::PB6<gpio::Analog>`
   --> src\timer\pins.rs:33:13
    |
33  | /             impl TimerPin<$TIMX> for $pin {
34  | |                 type Channel = $ch;
35  | |
36  | |                 fn setup(&self) {
...   |
42  | |                 }
43  | |             }
    | |             ^
    | |             |
    | |_____________first implementation here
    |               conflicting implementation for `gpio::gpiob::PB6<gpio::Analog>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant