-
Notifications
You must be signed in to change notification settings - Fork 37
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
how to actually read pins in Parts #32
Comments
@bsl, you'll get back collections of pin that you can use yorself or pass them to other drivers. They implement bunch of traits from Like everywhere in rust you need to bring those traits into scope to actually use their methods with Speaking of implemntations, I suggest you to take a look at alternative HAL impl for stm32f30x and number of examples we've built on top of that crate. |
Thanks for responding. I want to continue this thread in the hopes it will let you know what pain points users of these APIs might be experiencing. In my current project, I need to talk to a peripheral using I2C. I found an example in f3, and, despite it using this Update: OK, I think I see that I can mess around with |
@bsl have you read this blogpost by author of this crate? I'm not the author, and I don't belong to any of rust-embedded workgroups, but I think the idea behind embedded-hal is that you want to use hal implementation, like this crate, to setup up everything, and then use embedded-hal traits to actually use stuff: communicate via i2c, write to uart, switch pin states, etc. So, when using hal crate, like this, after you've set everything up and has frozen, constrained, or splited peripherals, you should use embedded-hal traits. I would say, that if you're not going to use any embedded-hal drivers and such, you may as well use |
This is probably related to the issue I just filed #35 |
Dude, I'm sure you are doing some very intelligent stuff in this API, but I am dying here trying to find out if an input pin is high or low. :(
In some older or lower-level API, I would do stuff like get a
Peripherals::GPIOA
, which hasidr
which can beread
, etc. In order to make types work in a newer example, I'm getting my gpioa fromGPIOA.split
, which I don't really understand, because it gives me aParts
. But that does have apa8
, which is what I'm interested in, but is it actually possible to do anything with this? I seem to be able to configure it to be various alternate functions, but is there a way to actually read its value??The text was updated successfully, but these errors were encountered: