Rahix / shared-bus

Crate for sharing buses between multiple devices
Apache License 2.0
129 stars 34 forks source link

Added SPI proxy, swapped to embedded-hal-mocks for testing #2

Closed ryankurte closed 5 years ago

ryankurte commented 5 years ago

Hi hi, this adds an SPI proxy, and swaps tests to use embedded-hal-mock rather than their own implementation. If you'd prefer I can revert the test changes and write a standalone one.

Rahix commented 5 years ago

Hello, sorry for the late response ... Thank you very much for this PR! SPI support is definitely a good addition and the embedded-hal-mocks also look much better than my hack.

A few things:

ryankurte commented 5 years ago

Thanks for the response! I'm looking forward to playing with some SPI things.

I've reverted the suggestions, but I'm too far down the squashing path to split it out really. Can close this and open another PR if you'd prefer.

Rahix commented 5 years ago

No need to, looks good now! I'll merge this today in the evening.

ryankurte commented 5 years ago

Hmm, docs.rs seems to hide the path of the implemented traits which makes it hard to interpret what is available, is there anything we can do about that?

screen shot 2018-10-31 at 8 39 48 am

My only idea is maybe renaming T to I2C and SPI so it appears in line at least.

Rahix commented 5 years ago

Yes, I noticed that as well ... Your idea sounds good, I'll see what I can do!

Rahix commented 5 years ago

This is what I came up with ... Would you be ok with this design?

screenshot_2018-10-31 shared_bus proxy busproxy - rust

ryankurte commented 5 years ago

Looks excellent to me!