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

[stm32] [timer] [qei] allow configuration of pull-up/down internal re… #3728

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leehambley
Copy link

…sistors on QeiPin

Adjusts the macros for impl<'d, T: GeneralInstance4Channel> QeiPin<'d, T, $channel> to take a 2nd argument which pullup/down should be active for the pins.

Related to #3721 (comment)

This may not be ready to merge yet. I certainly would appreciate feedback from upstream.

I verified this works with a Bluepill clone and a Nucleo F031K6.

@leehambley leehambley force-pushed the stm32-qei-allow-pupd branch 6 times, most recently from f5d0a13 to 0e924f7 Compare January 9, 2025 23:45
…sistors on QeiPin

Refactor STM32 QEI to use Config struct to emulate UART peripheral and allow config of internal pull-up and -down, and enable setting encoder mode.

Warn: Breaking API change

So far as possible this is sympathetic to how I understood the UART module/peripheral.

I kept things minimally configurable and future prood at the expense of a breaking API change by removing the QeiPin.

I kept as much type discrimination code as I could, the specific generic traits about Channel1Pin and Channel2Pin from the timer parent module, and keeping owned references to the pins.

I _removed_ some of the use of PhantomData as my naïve reading of the code leads me to believe it's not necessary now, and my breadboarded EC11 encoder toy works with all combinations of PU/PD and different counter modes.

Thanks for taking the patch.

boop
@leehambley leehambley force-pushed the stm32-qei-allow-pupd branch from 0e924f7 to 56a0294 Compare January 10, 2025 07:07
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

Successfully merging this pull request may close these issues.

2 participants