Skip to content

digital::InputPin API #41

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

Closed
japaric opened this issue Feb 15, 2018 · 10 comments
Closed

digital::InputPin API #41

japaric opened this issue Feb 15, 2018 · 10 comments

Comments

@japaric
Copy link
Member

japaric commented Feb 15, 2018

This trait became available in release v0.1.1 behind the "unproven" Cargo feature.

@therealprof
Copy link
Contributor

Implemented in nrf51-hal = "0.4.1" and used in microbit = "0.4.1".

@Nemo157
Copy link

Nemo157 commented Mar 6, 2018

Would this be the correct trait to include some sort of simple edge detection API (e.g. for buttons hooked up to GPIO)?

wez added a commit to atsamd-rs/atsamd that referenced this issue Mar 18, 2018
@caemor
Copy link

caemor commented Sep 17, 2018

Does this api still needs more drivers?

It seems to be quite stable since it's introduction half a year ago.

@caemor
Copy link

caemor commented Sep 18, 2018

The only problem I found with this api since using it is that errors can't get propagated any further and need to be converted to a default value.

E.g. the linux sys_fs can receive an file error while trying to read the value (https://github.com/rust-embedded/rust-sysfs-gpio/blob/master/src/lib.rs#L337) and this can't be handled by a simple bool.

@eldruin
Copy link
Member

eldruin commented Sep 21, 2018

I also stumbled upon the same problem as @caemor with both InputPin and OutputPin traits. In an I2C I/O expander driver I am writing I want to provide access to the individual pins as a bunch of Px structs implementing OutputPin and InputPin. At the moment I have seen no other choice but to panic if there was a problem for either reading or writing.

Should we discuss this in a separate issue?

@ryankurte
Copy link
Contributor

Interesting problems! I think as this spans all operations (not just Digital::InputPin) another issue would be great ^_^

@nils-van-zuijlen
Copy link
Contributor

If this API does not need driver nor implementation, when will it be proven ?

@therealprof
Copy link
Contributor

The problem is: There's no process to mark something as proven. There's a new RFC open #163 in attempt to completely revamp the way we get things added/changed.

Since there're enough implementations already we could simply accept a PR to mark it proven.

nils-van-zuijlen added a commit to nils-van-zuijlen/embedded-hal that referenced this issue Nov 14, 2019
See rust-embedded#41 for more details about this trait.

Removes the feature flag from v2 implementation

Keeps it on v1 because it would not make sense to prove a deprecated
feature.
nils-van-zuijlen added a commit to nils-van-zuijlen/embedded-hal that referenced this issue Nov 17, 2019
See rust-embedded#41 for more details about this trait.

Removes the feature flag from v2 implementation

Keeps it on v1 because it would not make sense to prove a deprecated
feature.
bors bot added a commit that referenced this issue Nov 17, 2019
164: Make the digital::{v1, v2}::InputPin traits proven r=therealprof a=nils-van-zuijlen

See #41 

Previous attempt : #102 

Co-authored-by: Nils VAN ZUIJLEN <[email protected]>
@rubberduck203
Copy link

I think this issue can be closed.

@therealprof
Copy link
Contributor

Fair enough.

peckpeck pushed a commit to peckpeck/embedded-hal that referenced this issue Nov 10, 2022
42: Update gpio-cdev and add MSRV r=posborne a=eldruin

Using `gpio-cdev` 0.3 we have a MSRV of 1.36.0 due to `nix`.
This superseeds rust-embedded#41 

Co-authored-by: Diego Barrios Romero <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants