ch32: Add usbd peripheral - #995
Open
Grazfather wants to merge 5 commits into
Open
Grazfather wants to merge 5 commits into
Grazfather wants to merge 5 commits into
Conversation
Grazfather
marked this pull request as draft
July 25, 2026 13:54
Grazfather
force-pushed
the
ch32_usbd
branch
from
September 12, 2026 13:13
baf94a7 to
5c55300
Compare
Grazfather
marked this pull request as ready for review
September 12, 2026 13:28
Grazfather
force-pushed
the
ch32_usbd
branch
2 times, most recently
from
September 26, 2026 15:31
e19110a to
7f1e65b
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
PMA sizing, control-transfer handling, GPIO clocking, and board UART initialization contain functional defects.
Review effort: Balanced
Findings: 3
Open (4)
What changed in this PR
Adds a selectable PMA-based USBD backend for CH32V203 boards while standardizing USB setup APIs.
Changes:
- Implements the USBD driver, clock setup, and board-level selection.
- Updates USBFS/USBHS to the uniform
SetupAPI. - Adds LANA TNY USB CDC support and board configuration.
| File | Description |
|---|---|
port/wch/ch32v/src/hals/usbhs.zig |
Adopts uniform USB setup API. |
port/wch/ch32v/src/hals/usbfs.zig |
Adopts uniform USB setup API. |
port/wch/ch32v/src/hals/usbd.zig |
Implements PMA-based USBD backend. |
port/wch/ch32v/src/hals/clocks.zig |
Adds USBD clock configuration. |
port/wch/ch32v/src/hals/ch32v20x.zig |
Selects USB backend by board. |
port/wch/ch32v/src/boards/Suzuduino_Uno_V1b.zig |
Adds USB and UART setup. |
port/wch/ch32v/src/boards/nanoCH32V203.zig |
Adds USB setup. |
port/wch/ch32v/src/boards/LANA_TNY.zig |
Selects and initializes USBD. |
port/wch/ch32v/src/boards/CH32V307V-R1-1v0.zig |
Adds USB and UART setup. |
examples/wch/ch32v/src/usb_cdc.zig |
Uses board USB setup. |
examples/wch/ch32v/build.zig |
Adds LANA TNY CDC target. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Collaborator
Author
|
Note that I re-tested on my LANA_TNY after these fixes today. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.