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

Structs for memory mapped core register definitions #194

Open
tudortimi opened this issue Sep 28, 2024 · 4 comments
Open

Structs for memory mapped core register definitions #194

tudortimi opened this issue Sep 28, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@tudortimi
Copy link
Contributor

Are there any plans to also define structs for the memory mapped core registers? Currently, only bitmasking is supported. Structs would make code easier to read (at the cost of more instructions, I guess).

For example, the SAU registers only have mask/pos defines:

image

For the non-memory mapped SFRs, there are also structs (e.g. APSR) in addition to the mask/pos defines:

image

@JonatanAntoni
Copy link
Member

Hi @tudortimi,

We do not have immediate plans to enhance CMSIS definitions.
Please feel free to raise a suggestion as a Pull-request.

I am happy to accept your contributions.

Thanks,
Jonatan

@tudortimi
Copy link
Contributor Author

Do you use any tool for the definitions of the pos/msk defines which takes the register descriptions from the architecture? I could see how to plug something like this in there.

@JonatanAntoni
Copy link
Member

No, we are not using any tools. The CMSIS core header files are manually maintained so far.

@tudortimi
Copy link
Contributor Author

tudortimi commented Oct 2, 2024

I'll raise a PR to add this for one of the cores (e.g. CM33) first, to have a first look. It's gonna take some time, though, do you mind that the issue stays open? Also, could you assign it to me so it shows up in my TODO list?

@JonatanAntoni JonatanAntoni added the enhancement New feature or request label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants