Skip to content

Comments

Stm32 usart: implement pin config for cts, tx, rts and de#3965

Merged
Dirbaio merged 5 commits intoembassy-rs:mainfrom
toon23:stm32_usart-pin_config
Apr 18, 2025
Merged

Stm32 usart: implement pin config for cts, tx, rts and de#3965
Dirbaio merged 5 commits intoembassy-rs:mainfrom
toon23:stm32_usart-pin_config

Conversation

@toon23
Copy link

@toon23 toon23 commented Mar 13, 2025

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.

@toon23 toon23 force-pushed the stm32_usart-pin_config branch from 87854e7 to 7a4fc64 Compare March 13, 2025 10:35
PushPull,
#[cfg(not(gpio_v1))]
/// Push pull with internal pull up resistor
PushPullPullUp,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PushPullPullUp and PushPullPullDown make no sense. If the MCU is always driving the pin the pull resistor has no effect (other than wasting current).

OpenDrainExternal,
#[cfg(not(gpio_v1))]
/// Open drain output using internal pull up resistor
OpenDrainInternal,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@toon23 toon23 force-pushed the stm32_usart-pin_config branch from 7a4fc64 to de06406 Compare April 12, 2025 19:06
@toon23
Copy link
Author

toon23 commented Apr 13, 2025

Thanks for the review @Dirbaio. You are right in both cases, I have changed the code accordingly.

@toon23 toon23 force-pushed the stm32_usart-pin_config branch from 18f12cb to 72ef809 Compare April 16, 2025 18:42
@toon23 toon23 force-pushed the stm32_usart-pin_config branch from 72ef809 to 94c208b Compare April 16, 2025 18:42
Copy link
Member

@Dirbaio Dirbaio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@Dirbaio Dirbaio added this pull request to the merge queue Apr 18, 2025
Merged via the queue into embassy-rs:main with commit 3ffee5e Apr 18, 2025
7 checks passed
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