rp2040-pac
rp2040-pac copied to clipboard
Add atomic XOR/set/clear access
While I suspect this is something that might be added through svd2rust I still think its useful to mention here:
According to 2.1.2 from the datasheet most registers allow XORing, setting or clearing of individual bits by writing to offset 0x1000, 0x2000 or 0x3000 from the base register. This is useful in a lot of cases to circumvent a read/modify cycle.
Afaik this is not supported by the pac at the moment..
I think I see something similar here in svd2rust
https://github.com/rust-embedded/svd2rust/blob/a02a5cff00e90e617dcc53b24003c1b83d02f4bb/src/generate/generic_msp430_atomic.rs
I opened an issue upstream https://github.com/rust-embedded/svd2rust/issues/535
For reference the rp2040-hal currently implements it via the atomic_register_access module