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

Cannot change timer input polarity #478

Open
samueltardieu opened this issue Jan 25, 2024 · 0 comments
Open

Cannot change timer input polarity #478

samueltardieu opened this issue Jan 25, 2024 · 0 comments

Comments

@samueltardieu
Copy link
Contributor

While working with an QEI encoder, I could not find a safe way of changing the polarity of one of the encoders inputs. I had to use

        unsafe {
            stm32f1xx_hal::pac::Peripherals::steal()
                .TIM2
                .ccer
                .modify(|_, w| w.cc2p().set_bit());
        }

after Timer::new() since this method resets the timer to its default configuration, so it is not possible to configure CCER in advance.

There should be a way of changing the polarity either from the Timer object or from the Qei one.

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