-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the ability to work with W
outside of write
#708
Comments
W
outside of `write'W
outside of write
Thanks for suggesting this! We discussed it at the end of today's meeting (here) though didn't really come to any conclusions yet. I think one problem is that even if we added a const let mut w: stm32f405::tim2::cr1::W = unsafe { core::mem::transmute(0) };
w.opm().enabled();
tim2.cr1.write(|_| w.cen().enabled());
Making a whole new function that takes It's worth noting that |
Thank you for considering the proposal! Let me clarify a little how I imagine it:
After that, instead of write(|w| w.f1().a1().f2().a2()); you can write write_value(*pac::peripheral::register::INITIAL_VALUE.f1().a1().f2().a2()); or for example let mut val = pac::peripheral::register::INITIAL_VALUE;
val.f1().a1();
val.f2().a2();
write_value(val);
const VAL: pac::peripheral::register::W = *pac::peripheral::register::INITIAL_VALUE.f1().a1().f2().a2();
write_value(VAL); Instead of reset(); you can write write_value(pac::peripheral::register::INITIAL_VALUE); |
I want for example instead of this
to do so
Or for example like this
Is it possible to change
svd2rust
to allow this?The text was updated successfully, but these errors were encountered: