-
Notifications
You must be signed in to change notification settings - Fork 434
Add bounded-registers to tools #222
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
Conversation
rust-highfive
commented
Nov 27, 2019
r? @therealprof
(rust_highfive has picked a reviewer for you, use r? to override)
For personal interest:
This looks very similar to the widespread tock-register-interface, which we also reuse in register-rs internally here.
How does this one differ from tock?
It's intentionally very similar to the tock-register-interface; with the addition of type-based bounds checking.
The author, Dan, has a blog post covering some of the motivations
if interested: https://blog.auxon.io/2019/10/25/type-level-registers/
Thanks!
We have register-rs further down in the list too.
I think it could be beneficial for users to list them side-by-side and concisely explain the differences. Otherwise it's just by chance what users stumble upon first instead of making an informed decision.
Would you be up helping with that?
Register-rs is basically tock registers with added support for cpu register definition using the same API as for the MMIO ones. So for bigger projects you then have homogenous interfaces to registers of all kinds.
So we would put that explanation, plus the differences between the bounded and tock crates.
I think tock's API has some more features as well at this point? The newly gained register block definition macro comes to my mind. Does bounded have something like InMemoryRegister too?
Best,
Andre
Good idea 👍, I'm happy to do that.
I'll take a look at the latest Tock API and push up a change to relocate the item alongside register-rs as well as some delineation between them once I'm back from holiday travels.
I don't think bounded-registers has an explicit equivalent to InMemoryRegister or register_structs macro, both would be really nice to have though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thank you.
bors r+
222: Add bounded-registers to tools r=andre-richter a=jonlamb-gh For anyone curious about what bounded-registers look like, I have been hacking on a personal `bcm2711` crate in my Raspberry Pi 4 bare metal workspace. https://github.com/jonlamb-gh/rpi4-rust-workspace Co-authored-by: Jon Lamb <jon@auxon.io> Co-authored-by: Andre Richter <andre-richter@users.noreply.github.com>
For anyone curious about what bounded-registers look like, I have been hacking on a personal
bcm2711
crate in my Raspberry Pi 4 bare metal workspace.https://github.com/jonlamb-gh/rpi4-rust-workspace