swift-mmio
swift-mmio copied to clipboard
Register.write() should have doccomments highlighting that the new value is starting with all bits set to 0
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).
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.