Stm32 usart: implement pin config for cts, tx, rts and de#3965
Merged
Dirbaio merged 5 commits intoembassy-rs:mainfrom Apr 18, 2025
Merged
Stm32 usart: implement pin config for cts, tx, rts and de#3965Dirbaio merged 5 commits intoembassy-rs:mainfrom
Dirbaio merged 5 commits intoembassy-rs:mainfrom
Conversation
87854e7 to
7a4fc64
Compare
Dirbaio
reviewed
Apr 7, 2025
embassy-stm32/src/usart/mod.rs
Outdated
| PushPull, | ||
| #[cfg(not(gpio_v1))] | ||
| /// Push pull with internal pull up resistor | ||
| PushPullPullUp, |
Member
There was a problem hiding this comment.
PushPullPullUp and PushPullPullDown make no sense. If the MCU is always driving the pin the pull resistor has no effect (other than wasting current).
Dirbaio
reviewed
Apr 7, 2025
embassy-stm32/src/usart/mod.rs
Outdated
| OpenDrainExternal, | ||
| #[cfg(not(gpio_v1))] | ||
| /// Open drain output using internal pull up resistor | ||
| OpenDrainInternal, |
Member
There was a problem hiding this comment.
I'd call these OpenDrain and OpenDrainPullUp. This is more consistent with the GPIO driver. It doesn't concern what's on the board, just what the MCU itself is doing (enable pullup, or not enable pullup)
added 4 commits
April 11, 2025 20:58
The pin parameters of usart::Config are used instead.
7a4fc64 to
de06406
Compare
Author
|
Thanks for the review @Dirbaio. You are right in both cases, I have changed the code accordingly. |
18f12cb to
72ef809
Compare
72ef809 to
94c208b
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.
Allows pin configuration for cts, tx, rts and de pin in usart::Config. The configuration is applied in all Uart drivers.
Also I removed the now rendundant HalfDuplexConfig which I used as base for the pin config implementation.