stm32-data icon indicating copy to clipboard operation
stm32-data copied to clipboard

Support for rc_w0 registers

Open peku33 opened this issue 1 year ago • 1 comments

Some registers, eg. TIMx_SR on stm32f0 are marked as rc_w0. This means that in order to clear specific bit we need to write all others as ones. Is there any chance we get native support for "set all as ones except selected"?

peku33 avatar Apr 19 '25 13:04 peku33

you can do it with

regs.some_reg().write(|w| {
   w.0 = 0xFFFF_FFFF;
   w.set_something(false);
});

Dirbaio avatar Apr 19 '25 22:04 Dirbaio