ARM-software / CMSIS_6

CMSIS version 6 (successor of CMSIS_5)
https://arm-software.github.io/CMSIS_6/
Apache License 2.0
187 stars 58 forks source link

Structs for memory mapped core register definitions #194

Open tudortimi opened 1 month ago

tudortimi commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

tudortimi commented 4 weeks ago

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?