rust-embedded / rust-embedded/svd2rust
[Corner Case] single bit field `MT` (Month Tens) of `RTC` should have `u8` type rather a `bool` type
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 857
- Forks
- 164
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how svd2rust maps the STM32 RTC DR.MT field from the SVD into its generated BitWriter and BitReader APIs. Determine where a field's Rust type could be specified, then verify that the generated MT interface supports the intended numeric type instead of requiring bool.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- embedded-iot, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100