Skip to content
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

riscv-pac crate #162

Merged
merged 4 commits into from
Dec 5, 2023
Merged

riscv-pac crate #162

merged 4 commits into from
Dec 5, 2023

Conversation

romancardenas
Copy link
Contributor

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:

  • InterruptNumber: for external interrupts
  • PriorityNumber: for encoding valid priorities
  • HartIdNumber: for enumerating the HARTs of the RISC-V target

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 romancardenas requested a review from a team as a code owner December 4, 2023 17:10
almindor
almindor previously approved these changes Dec 4, 2023
Copy link
Contributor

@almindor almindor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@romancardenas
Copy link
Contributor Author

romancardenas commented Dec 4, 2023

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

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for looking into this!

@MabezDev MabezDev added this pull request to the merge queue Dec 5, 2023
Merged via the queue into master with commit c579937 Dec 5, 2023
58 checks passed
@romancardenas romancardenas deleted the riscv-pac branch December 7, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants