adamgreig/stm32ral

Reset flag has no counterpart like Enabled/Disabled

pftbest opened this issue · 1 comments

For example to reset SPI I need to do two operations:
First set Reset flag:

let rcc2 = stm32ral::rcc::RCC::take().unwrap();
modify_reg!(stm32ral::rcc, rcc2, APB1RSTR, SPI2RST: Reset);

Then I need to clear it:

modify_reg!(stm32ral::rcc, rcc2, APB1RSTR, SPI2RST: 0);

But there is no constant defined for this, so I have to use literal 0 instead. It would be great to have a flag like ResetClear for example.

Good point, probably just Clear would work even. This would need to be fixed in stm32-rs upstream, i.e. by adding some Clear values to this field, and then stm32ral could be updated.