swift-mmio icon indicating copy to clipboard operation
swift-mmio copied to clipboard

Register.write() should have doccomments highlighting that the new value is starting with all bits set to 0

Open kubamracek opened this issue 11 months ago • 1 comments

While writing some MMIO code, I wasn't sure if .write { $0.raw.someBit = 1 } is going to retain the other bits or not. I only found out the answer the hard way (stuff didn't work at runtime) and then reading the source code made it clear. Would be great to highlight this in a doccomment (and point out users to .modify instead, because it seems like .write is only very rarely useful).

kubamracek avatar Apr 05 '25 20:04 kubamracek

This is only sorta true, the goal is for swift-mmio's write method to actually use the registers reset value as the initial bit pattern, this just isn't implemented yet.

rauhul avatar Apr 25 '25 00:04 rauhul