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

Allow for alternateGroup #7

Open
jacquelinekay opened this issue Feb 6, 2017 · 1 comment
Open

Allow for alternateGroup #7

jacquelinekay opened this issue Feb 6, 2017 · 1 comment

Comments

@jacquelinekay
Copy link
Collaborator

https://www.keil.com/pack/doc/CMSIS/SVD/html/elem_registers.html

"A register description is defined either for a unique address location or could be a redefinition of an already described address. In the latter case, the register can be either marked alternateRegister and needs to have a unique name, or it can have the same register name but is assigned to a register subgroup through the tag alternateGroup (specified in version 1.0)."

The TI boards exercise this feature, including:

TM4C1233D5PM
TM4C1237E6PM
TM4C123GH6ZRB
@jacquelinekay
Copy link
Collaborator Author

My initial solution for this isn't quite correct.

I decided to simply append the fields of the register redefinition to the original register.

I'm now running into a problem with ATSAMD21E16A where a register redefinition using "alternateGroup" redefines a field with the same name as the original field.

I think the correct solution is to encapsulate register groups in a different namespace. I believe a register group is simply a different naming schema for the same set of registers. So for example, the baud rate register group "A" for a register can be A::baud and B::baud for register group B.

The use case for this is fields with the same name but different bit widths. For example, the board in question offers a fractional mode for the baud rate register: default_mode::baud has a bit width of 16 and frac_mode::baud has a bit width of 13, with an additional field frac_mode::fp with a bit width of 3.

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