CH34x: add RTS/CTS flow control, correct 307200 baud rate, and timeout - #642
Draft
midnight-wonderer wants to merge 3 commits into
Draft
CH34x: add RTS/CTS flow control, correct 307200 baud rate, and timeout#642midnight-wonderer wants to merge 3 commits into
midnight-wonderer wants to merge 3 commits into
Conversation
Author
NotesThe magic number Open Questions@kai-morich I wonder if we should log |
…dd baud rate validation
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.
This PR introduces three improvements and fixes to the
Ch34xSerialDriver:setFlowControlandgetSupportedFlowControl.0x2727(0x0101to enable,0x0000to disable) matching standard controller behavior.openInt().307200baud (divisor = 7andfactor = 0xd900). This matches the divisor configuration used in standard operating system drivers, yielding much lower frequency deviation and more reliable communication at this rate.0x0f2ccontrols the USB upload packet timeout, which determines how long the chip buffers received data before flushing.12instead of64at1200baud), leading to premature packet flushes and unnecessary CPU overhead.76800 / baudRate(minimum0x07, capped at0xFF) and write this to register0x0f2c.These changes have also been integrated into the device test suite (
DeviceTest.java) by configuring the expected flow control lock state (ON_BUFFER_FULL) for CH34x.