rust-embedded / riscv

Low level access to RISC-V processors
822 stars 160 forks source link

riscv-pac crate #162

Closed romancardenas closed 9 months ago

romancardenas commented 9 months ago

This PR mimics the approach followed in cortex-m. The idea is to isolate those traits that must be implemented by PACs from other parts of our ecosystem that use them.

In the (very) near future, I plan to move the riscv-peripheral crate here for standard peripherals. These will rely on the traits of riscv-pac to provide functionality. In this way, it will be less harmful to add breaking changes to the peripherals.

So far, I added three main traits:

All these traits expect PACs to i) provide conversions to/from numbers and ii) specify the greatest expected value. The latter will help third-party tools such as RTIC to provide support for RISC-V targets.

romancardenas commented 9 months ago

Ooops sorry, pushed new stuff to the wrong branch D: I think it is now good to go