-
Notifications
You must be signed in to change notification settings - Fork 265
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
feat: uart tx software break #3177
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sticking with this! It's closer to ready, but still needs some changes.
Regarding async
break, I'm not sure how to handle it. This way of breaking, which I now understand is required thanks to your comment in the old PR, isn't that friendly to async
as we can't set an interrupt to detect when the break is done. Not sure how to go about this just yet, so I think you're right to leave the async version out for now.
Regarding the separate PRs, I suggest you fold the RX side of this (#2858) into here. Along with the test suggestions I've already made, it'll be good to test that each side can transmit and receive a break from the same uart peripheral.
|
||
loop { | ||
// Send a break signal for 20 bits | ||
uart.send_break(20); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is inadequate, we need something to check the signals coming from the UART TX line. We usually use PCNT or RMT for this purpose, check out some of the other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just for the examples/
to demonstrate the usage, where would the test go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, I didn't quite release what I was looking at 😅 . Take a look at the hil-test
package, writing tests there will run them on the esp's we have in our server room. The README in there should explain most things, and looking at the tests for inspiration should help too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I fold the break interrupt PR into this, I'll HIL test the two together as well.
TODO
|
I would strongly prefer not emulating this with a delay and flipping TXD. The hardware is capable of generating at least a limited length of break condition, we should try to get that working.
|
|
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo xtask fmt-packages
command to ensure that all changed code is formatted correctly.CHANGELOG.md
in the proper section.Extra:
Pull Request Details 📖
Description
Accidentally closed #2872 trying to update my fork --
Adding ability to send a software break on the UART TX line. This is achieved by inverting the TX line, waiting some time, and then reverting the line back. The duration to leave it inverted (the break duration) is kept in bit time - the time it takes to send one bit at the current baud rate.
Testing
Ongoing