-
Notifications
You must be signed in to change notification settings - Fork 49
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
base: main
Are you sure you want to change the base?
F4 GPIO #186
Conversation
e122258
to
cd18012
Compare
5b40c21
to
83e5b28
Compare
cc @usbalbin |
_tx: TX, | ||
_rx: RX, | ||
pins: (impl Into<Self::Tx>, impl Into<Self::Rx>), |
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.
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>>, |
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 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 :)
No description provided.