Half-duplex becomes a compile-time feature with a shared-wire drive discipline#32
Merged
Conversation
ee7563c to
41e1053
Compare
41e1053 to
f8c5fe6
Compare
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.
Half-duplex worked point-to-point but couldn't sit on a shared (multi-drop) wire: the pin idled push-pull, driving against other talkers, and enabling TE before HDSEL latched the TX output LOW — clamping the bus from init until the first own transmission (measured on CH32V006).
Breaking: duplex selection moves from runtime config to compile time. The
Duplexenum andUsartConfig::duplexare gone; single-wire operation is now thehalf-duplexcargo feature (rx_pullonly exists without it). A bootloader binary serves one board, so there's no runtime switch worth paying for — full-duplex binaries are byte-identical to before, which matters on the CH32V003's 1920-byte system flash.With the feature on, the wire follows a shared-bus drive discipline:
usart::initraises HDSEL before TE, so the TX output idles at mark from the start.The transports guide, troubleshooting doc, and examples are updated, including the new hardware requirement: an external pull-up on the wire. CI gains a
half-duplexclippy leg per family.