Parallel OutputBus trait - #20
Conversation
therealprof
commented
Mar 14, 2021
That's a good improvement, I like it. Nit: Your example impl of NB: I have been meaning to add support for parallel busses to |
andresovela
commented
Mar 15, 2021
Looks like a great alternative to me, but I'll have to say that this still doesn't fully fix #18, because the user can still implement a custom |
andresovela
left a comment
There was a problem hiding this comment.
I think with these changes this would fix #18
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
GrantM11235
commented
Mar 15, 2021
Thanks!
Oops, fixed
An
Thanks!
The An implementation of I will be sure to make a note of all of this when I write the docs. |
andresovela
commented
Mar 15, 2021
Yeah I know, I'm not arguing that
This is already the case. A user implementing a Anyway, now that I think about it, with your implementation this is a non-issue, because if such a problem comes up it will be the user's fault and not this crate's fault, since the user has the responsibility of implementing this correctly. |
GrantM11235
commented
Mar 15, 2021
Exactly 😉 |
therealprof
commented
May 9, 2021
I think this is a great PR. Is this ready to be merged? |
GrantM11235
commented
May 9, 2021
It is now! 👍 Let me know if I should squash anything. |
therealprof
commented
May 9, 2021
A squash would be nice, yes. |
therealprof
left a comment
There was a problem hiding this comment.
LGTM, thanks for sticking with me.
OutputBus
This PR changes
PGPIO8BitInterfaceto use a simpleOutputBustrait instead of a bunch of individual pins:Generic8BitBus
This PR also provides an
OutputBusimplementation that can be constructed from 8OutputPins:or
(Note that the construction is fallible because it attempts to set all the pins low, which fixes#18)
Custom OutputBus
For reference, here is an example of an optimized
OutputBusimplementation for an stm32f1 with a bus on pins PB0 through PB7Pros
PGPIO8BitInterfacedoesn't take a million arguments anymoreOutputBuswith much higher performanceCons
OutputBusbefore they can construct aPGPIO8BitInterface. This is slightly more verbose, but it is more readable in my opinionTodo