Is the Half/Full duplex type state distinction really needed on the Spi driver? #1853
Closed
Dominaezzz
started this conversation in
General
Replies: 2 comments 3 replies
-
I think the original idea to have the type was because pins are in different modes depending on the type (push-pull, input vs open-drain). We could just have multiple constructors (without the type state) but the type state keeps users from calling functions which don't make sense depending on which constructor they used |
Beta Was this translation helpful? Give feedback.
2 replies
-
I think with #1985 the need for duplication goes away, so we can probably add half duplex support back? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I don't really see much point to this distinction.
The full duplex driver can still make half duplex transfers and all the pins are optional.
I reckon most users just create a full duplex driver regardless of which duplex mode they need or not, since discovering the existence of
new_half_duplex()
is not something I think people will do immediately.Can we just remove the generic parameter and reduce the duplication between both or is there something I'm missing?
Beta Was this translation helpful? Give feedback.
All reactions