embassy-rs / embassy-rs/chiptool

prefixes for field enums appear to be inconsistently present

Open
#95 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
65
Forks
54
PR merge metrics
No merged PRs in 30d

Description

I am looking at chiptool output. Is there a reason why some enums appear to be prefixed with the register name and some appear to be unprefixed?

On my LPC55S16 in the syscon peripheral, I have a couple registers called AhbClkCtrl0/1.

On 0, I have a field called "ROM" that generates an enum called `AhbClkCtrl0Rom`.

On 1, I have a field called "FC0" that generates an enum called `Fc0`.

I would have expected the enum for the 1 register to, `AhbClkCtrl1Fc0` instead of the bare `FC0`.

It's not clear to me why one gets the prefix and the other does not.

There's no obvious difference in the SVD. The registers are defined within the same parent and seem to have the same attrs set.

AHBCLKCTRL0:
```xml

AHBCLKCTRL0
AHB Clock control 0
AHBCLKCTRL
0x200
32
read-write
0x180
0xCFFE9FA


ROM
Enables the clock for the ROM.
1
1
read-write


DISABLE
Disable Clock.
0


ENABLE
Enable Clock.
0x1



...more fields...

```

AHBCLKCTRL1:
```xml

AHBCLKCTRL1
AHB Clock control 1
AHBCLKCTRL
0x204
32
read-write
0
0xDE57FC47

...more fields...

FC0
Enables the clock for the FC0.
11
1
read-write


DISABLE
Disable Clock.
0


ENABLE
Enable Clock.
0x1



...more fields...


```

The values differ for the resetMask and the resetValue and the addressOffset. Identical otherwise.

See here for the original SVD I copied these from: https://raw.githubusercontent.com/nxp-mcuxpresso/mcux-soc-svd/refs/heads/release/25.06.00/LPC55S16/LPC55S16.xml

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.