svd2zig icon indicating copy to clipboard operation
svd2zig copied to clipboard

Expose bit-banded register access

Open simonschmidt opened this issue 4 years ago • 1 comments

Some arm processors expose bit-banding to read/write bits of peripheral registers. This provides more efficient access when reading/writing a single bit in a register

It would be convenient to expose the bit-banding in the register structs generated by svd2zig, I made an example in #3

However it would add some more complexity, especially since this information is not available in the SVD files, so it could easily be argued that this is out of scope for svd2zig, and is perhaps something that would be better to add manually to supported platforms after generating the .zig file.

Anyway, I figured I'd raise the topic for discussion here

simonschmidt avatar Mar 21 '21 14:03 simonschmidt

Feels out of scope for this library since the info isn't in the SVD files. Do the Rust folks expose any of this in their SVD patches? https://github.com/stm32-rs/stm32-rs/tree/master/devices

That said I don't have any experience with bit-banding so may not be able to really discuss it in depth --- but feel free to do so if you have ideas and think others running across this repo would be interested to participate in a discussion here.

lynaghk avatar Mar 23 '21 14:03 lynaghk