-
Notifications
You must be signed in to change notification settings - Fork 188
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
Requesting a PullUp Input pin #148
Comments
Your question is very unspecific, which is probably the reason no one could answer it.
You might also want to read https://stackoverflow.com/help/how-to-ask to have a higher chance of someone helping you. |
My apologies, I did not notice the markdown eating my code sample and have edited the post accordingly. Let me post what I'm doing using stm32f1xx_hal right now to read
Now the way stm32f1xx-hal works I can only 'downgrade' pins up to the port level, and I need to accept multiple arguments to accept them all. Accordingly, my read_matrix() function has every loop twice:
Apart from that this is the easiest and most straight forward way to implement a key matrix, There are two macro based crates for this task, one reads the matrix every time you want to read out any one pin (https://crates.io/crates/keypad), the other ( https://crates.io/crates/keymatrix ) has essential no documentation and appears to be 'wasting' a u8 per pin. Basically, all I want to say is 'give me a trait object to an Input Pin with a PullUp. Any input pin. |
I don't have a solution for the problem at hand, but I'd like to provide some context about the underlying problem. This style of representing pin types, generating one type per pin plus I've written previously about what I think is a better approach: nrf-rs/nrf-hal#8 It's already implemented this way in |
Dear embeded-hal Gurus,
I'd like my function to accept a
Vec<Box<dyn SomeTraitThatSaysInputWithPullUp>>
(I'm building as simple key matrix).
Is there any way to specify such currently?
The text was updated successfully, but these errors were encountered: