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

[Question] Dynamic register offset #12

Open
rmsyn opened this issue Mar 31, 2024 · 0 comments
Open

[Question] Dynamic register offset #12

rmsyn opened this issue Mar 31, 2024 · 0 comments

Comments

@rmsyn
Copy link

rmsyn commented Mar 31, 2024

In some peripherals, a register offset is defined by reading the value of another register at runtime.

For example, the USB XHCI op and run registers:

The structure of the register clusters are static, and it looks like the value for those registers is likely to be static per actual implementation.

Is there a way to define these type of registers in SVD?

Something like leaving the addressOffset empty, and requiring the generated code to supply the offset as a parameter?

Another alternative I guess would be to run code on the board to query the values of the relevant registers, and use the result in the SVD per-implementation.

It may just be that higher-level abstractions (like actual drivers or HALs) are a better place to handle register definitions like those above.

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

No branches or pull requests

1 participant