rust-embedded / rust-embedded/svd2rust

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

Open
#719 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.