svd2rust icon indicating copy to clipboard operation
svd2rust copied to clipboard

[Corner Case] single bit field `MT` (Month Tens) of `RTC` should have `u8` type rather a `bool` type

Open eZioPan opened this issue 2 years ago • 1 comments

In STM32 svds, there is a field called MT of DR register in RTC peripheral. MT means Month Tens and should have numeric type. But since it's a single bit field, svd2rust just map it to a BitWriter & BitReader, which make the .bit() method need a bool input. It's a little bit weird for me. So if there is any way we can defined the Rust type of a field?

eZioPan avatar May 29 '23 09:05 eZioPan

There's no support for this in the current svd spec. Maybe we can enable a way to say periph RTC register DR field MT is a u8

Emilgardis avatar May 29 '23 10:05 Emilgardis