Skip to content

F4 GPIO #186

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

F4 GPIO #186

wants to merge 4 commits into from

Conversation

burrbull
Copy link
Member

No description provided.

@usbalbin usbalbin changed the base branch from staged-pac to main April 28, 2025 21:05
@burrbull burrbull force-pushed the f4-gpio branch 3 times, most recently from e122258 to cd18012 Compare May 27, 2025 12:15
@burrbull burrbull mentioned this pull request May 27, 2025
@burrbull burrbull mentioned this pull request May 28, 2025
@burrbull burrbull force-pushed the f4-gpio branch 4 times, most recently from 5b40c21 to 83e5b28 Compare May 31, 2025 20:17
@burrbull burrbull marked this pull request as ready for review June 10, 2025 08:09
@burrbull
Copy link
Member Author

cc @usbalbin

Comment on lines -34 to +29
_tx: TX,
_rx: RX,
pins: (impl Into<Self::Tx>, impl Into<Self::Rx>),
Copy link
Member

Choose a reason for hiding this comment

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

Why this change? Why a pair instead of two arguments?

pub struct Tx<USART: Instance, Dma, Otype = PushPull> {
pin: USART::Tx<Otype>,
pub struct Tx<USART: Instance, Dma = NoDMA, Otype = PushPull> {
pin: Option<USART::Tx<Otype>>,
Copy link
Member

Choose a reason for hiding this comment

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

This effectively makes this no longer a ZST? What is the advantage of the Option here as opposed to something like struct NoPin? Correct me if I am wrong but one disadvantage with Option is that you still have to specify the type even when passing None. That in my opinion defeats any ergonomics advantages vs just passing NoPin. Also there is not really any reduction in the amount of generic type parameters.

However I am still open to be convinced otherwise :)

@burrbull burrbull marked this pull request as draft June 10, 2025 19:22
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