-
Notifications
You must be signed in to change notification settings - Fork 149
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
Generate API for "write 1 to toggle" registers #176
Comments
To implement this we need to enable parsing of To make it work you'd have to patch this element into the SVD aswell <field>
<name>DTOG_TX</name>
<description>Data Toggle, for transmission
transfers</description>
<modifiedWriteValues>oneToToggle</modifiedWriteValues>
<bitOffset>6</bitOffset>
<bitWidth>1</bitWidth>
</field> |
Out of interest, did you get anywhere with this? Are you working on a USB driver? |
@ah- I haven't gotten anywhere with this yet, since working on svd2rust would be above my current experience with Rust. I have plans to work with the STM32f0 USB peripherals in a month or two, which is why I brought this up. If this begins to block my work on USB devices and I feel more comfortable with the language, I'd be glad to contribute or assist @Emilgardis following the plan that they have laid out. |
The STM32L4 I'm working with also uses
I guess supporting |
@bergus I haven't looked in detail, but I've seen mechanisms to override the svd and fix issues like that in https://github.com/adamgreig/stm32-rs. |
reopen if not fixed |
Hey all,
Over in rust-embedded/wg#40, user @kinnison brought up that some of the STM32's USB control registers have a "write 0 to leave alone; write 1 to toggle" interface, and that svd2rust isn't generating the proper API for these registers. Since he hasn't filed an issue here yet, this is my attempt to document the feature.
In particular, the STM32F0x2 has a register for each USB endpoint with six of these toggleable bits. These registers are described in RM0091 under the name
USB_EPnR
:Here is a link to the current output generated by svd2rust v0.12.0 from STM32F0x2.svd
STM32f0x2.svd
svd2rust API
Let me know if there's any other information I can dig up! I'm still learning embedded on Rust, and am really excited to see where things are headed.
The text was updated successfully, but these errors were encountered: