Skip to content
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

Add support for reconfiguring a Serial port #385

Merged
merged 1 commit into from
Jan 8, 2022

Conversation

horazont
Copy link
Contributor

@horazont horazont commented Jan 7, 2022

Example use case is to implement a 1-Wire Bus "Master". In that example, the UART is used instead of bit-banging the 1-Wire protocol. However, not all signals can be generated with a single baud rate. In particular, the 1-wire reset strobe is much longer than the 1-wire data strobes, requiring to use a different, slower baud rate to reset devices.

@burrbull
Copy link
Member

burrbull commented Jan 8, 2022

LGTM.
rustfmt, please.
And example maybe?

@horazont horazont force-pushed the feature/serial-change-config branch from 0da1409 to 11410eb Compare January 8, 2022 09:02
Example use case is to implement a 1-Wire Bus "Master" [1]. In that
example, the UART is used instead of bit-banging the 1-Wire protocol.
However, not all signals can be generated with a single baud rate. In
particular, the 1-wire reset strobe is much longer than the 1-wire data
strobes, requiring to use a different, slower baud rate to reset
devices.

   [1]: https://www.maximintegrated.com/en/design/technical-documents/tutorials/2/214.html

Signed-off-by: Jonas Schäfer <[email protected]>
@horazont horazont force-pushed the feature/serial-change-config branch from 11410eb to 65e63b2 Compare January 8, 2022 10:42
@horazont
Copy link
Contributor Author

horazont commented Jan 8, 2022

@burrbull Thanks for the feedback.

I fmt'd the code and added a simple example. A full UART-based 1-wire master would be quite complex and would fit more into a separate library.

Tested it with the STM32VLDISCOVERY board (had to adapt memory.x and use breakpoints instead of asm::bkpt locally).

@burrbull
Copy link
Member

burrbull commented Jan 8, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 8, 2022

@bors bors bot merged commit ce1d478 into stm32-rs:master Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants