-
Notifications
You must be signed in to change notification settings - Fork 151
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
support clusters #107
Comments
Blocker: svd doesn't parse |
Is anyone working on this at the moment? |
I would preferably use a cluster here, but svd2rust doesn't yet have that feature. See rust-embedded/svd2rust#149 and rust-embedded/svd2rust#107 closes japaric#16
This also affects https://github.com/jamesmunns/nrf52. I may look into implementing clusters. |
@japaric - how should <cluster>
<name>USART</name>
<description>USART Mode</description>
<alternateCluster>I2CM</alternateCluster>
<headerStructName>SercomUsart</headerStructName>
<addressOffset>0x0</addressOffset>
<register>
<name>BAUD</name>
<description>USART Baud Rate</description>
<alternateGroup>DEFAULT_MODE</alternateGroup>
<addressOffset>0x0C</addressOffset>
<size>16</size>
<fields>
<field>
<name>BAUD</name>
<description>Baud Rate Value</description>
<bitOffset>0</bitOffset>
<bitWidth>16</bitWidth>
</field>
</fields>
</register>
<register>
<name>BAUD</name>
<description>USART Baud Rate</description>
<alternateGroup>FRAC_MODE</alternateGroup>
<addressOffset>0x0C</addressOffset>
<size>16</size>
<fields>
<field>
<name>BAUD</name>
<description>Baud Rate Value</description>
<bitOffset>0</bitOffset>
<bitWidth>13</bitWidth>
</field>
<field>
<name>FP</name>
<description>Fractional Part</description>
<bitOffset>13</bitOffset>
<bitWidth>3</bitWidth>
</field>
</fields>
</register>
<register> Is there a tracking issue for |
182: Add initial Cluster support r=jamesmunns a=jamesmunns Add cluster support to svd2rust. I am calling it initial, because I have only tested it against the `nRF52` [svd file](https://github.com/jamesmunns/nrf52/blob/master/nrf52.svd). Note, this is based on #180, so I would prefer that PR be merged first. If that PR is rejected, I can instead rebase these changes on `japaric/master` (just let me know). Edit: All changes relevant to clusters are squashed into the last commit of this PR, so if you want to see the relevant changes, check out 6de6de7. This is based on the work of @brandonedens earlier #149, and I believe would close #107 and related issues. CC @japaric @Emilgardis @therealprof Edit 2: Here are some handy references: * [SVD snippet with clusters](https://gist.github.com/jamesmunns/c4e53fe5bd74dca81fdbff6bb1798ddd) * [code generated before](https://gist.github.com/jamesmunns/d854a6c2665cca59edb88143d82a19c6) * [code generated after](https://gist.github.com/jamesmunns/7558667e34c33124c60b3aaaf679a196) * [diff of code generated](https://gist.github.com/jamesmunns/03fd0d7d3595cd0816dbfa8daca0a553)
182: Add initial Cluster support r=jamesmunns a=jamesmunns Add cluster support to svd2rust. I am calling it initial, because I have only tested it against the `nRF52` [svd file](https://github.com/jamesmunns/nrf52/blob/master/nrf52.svd). Note, this is based on #180, so I would prefer that PR be merged first. If that PR is rejected, I can instead rebase these changes on `japaric/master` (just let me know). Edit: All changes relevant to clusters are squashed into the last commit of this PR, so if you want to see the relevant changes, check out 6de6de7. This is based on the work of @brandonedens earlier #149, and I believe would close #107 and related issues. CC @japaric @Emilgardis @therealprof Edit 2: Here are some handy references: * [SVD snippet with clusters](https://gist.github.com/jamesmunns/c4e53fe5bd74dca81fdbff6bb1798ddd) * [code generated before](https://gist.github.com/jamesmunns/d854a6c2665cca59edb88143d82a19c6) * [code generated after](https://gist.github.com/jamesmunns/7558667e34c33124c60b3aaaf679a196) * [diff of code generated](https://gist.github.com/jamesmunns/03fd0d7d3595cd0816dbfa8daca0a553)
19: Make EPnR into an array. r=japaric a=Emilgardis I would preferably use a cluster here, but svd2rust doesn't yet have that feature. See rust-embedded/svd2rust#149 and rust-embedded/svd2rust#107 closes #16
Example:
File: ATSAMD21E15A.svd
Contents:
These clusters seem to be non-functional. They only add more structure (namespaces) to a register block. The above is supposed to generate something like this:
The "flat" version would have resulted in a name collision between I2CM.ADDR and I2CS.ADDR.
We currently don't generate anything at all for clusters. For instance the above SERCOM0 peripheral is totally omitted in the output because it appears to have 0 registers as clusters are ignored.
The text was updated successfully, but these errors were encountered: