Conversation
|
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 |
|
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
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. |
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. |
Exactly 😉 |
|
I think this is a great PR. Is this ready to be merged? |
|
It is now! 👍 Let me know if I should squash anything. |
|
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