[Announce] tock-based registers
andre-richter opened this issue · 2 comments
Adding some people to whom it might be of interest. You are kindly invited to review, or just silently ignore ;)
@alevy @bradjc @niklasad1 @brghena @phil-opp @ryankurte @ppannuto
Hi all,
In tock/tock#930, I started my idea of having a common register interface for both CPU and MMIO registers based on the tock register interface. Thank you very much to the tock folks for carving out a crate for it!
Today, I finally have a first peek ready for one of my RaspberryPI 3 subprojects.
Check it out at https://github.com/andre-richter/rust-raspi3-tutorial/tree/registers/09_delays
There are some distributed components involved.
- First of all, I needed a 64-bit capable version of tock-regs.
PR pending tock/tock#1092 - Based on this, I created https://github.com/andre-richter/register-rs, which unifies the same interfaces for MMIO and CPU in a single crate.
- Using register-rs, I made a preview version of my cortex-a crate at https://github.com/andre-richter/cortex-a/tree/registers. It implements access to some common cortex-a registers.
In the end, you can see, for example in https://github.com/andre-richter/rust-raspi3-tutorial/blob/registers/09_delays/src/delays.rs, that MMIO and CPU accesses are side by side, using the same tock-regs API. Very very neat!
@andre-richter this is pretty cool!
All is now merged on master and published on crates.io.