-
Notifications
You must be signed in to change notification settings - Fork 234
Qei
API
#8
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
Comments
Update: this trait is available in release v0.1.0 behind the "unproven" Cargo feature. |
I wrote a library for a simple rotary encoder library, and after posting about it in the rust-embedded/awesome-rust thread, someone directed me to this trait, that I had no idea existed. I'm having trouble for seeing how to map to the methods provided in the trait. Particularly the
It's very possible I'm just not understanding something, but I can't see how it fits together at all. In my case, something like this would make a lot more sense: pub trait Qei {
type Count;
fn count(&self) -> Self::Count;
fn direction(&self) -> Option<Direction>;
} or even, fn direction(&mut self) -> Option<Direction> In this case, I can put the code that does the transformation of state -> Direction (and updates the internal |
9: Add serial::Read/Write implementation r=ryankurte a=rnestler So this is just a quick PoC to implement rust-embedded#8. @japaric Do you think it would be OK to implement it in that way? If yes I can finish it up. Co-authored-by: Raphael Nestler <[email protected]> Co-authored-by: Raphael Nestler <[email protected]> Co-authored-by: Danilo Bargen <[email protected]>
The text was updated successfully, but these errors were encountered: