rust-embedded / embedded-hal

A Hardware Abstraction Layer (HAL) for embedded systems
Apache License 2.0
1.95k stars 197 forks source link

I2c: simplify, expand docs, document shared bus usage. #440

Closed Dirbaio closed 1 year ago

Dirbaio commented 1 year ago

~Depends on #441 -- check that one out first.~

This does some simplifications to the trait that I think we should do:

It also specifies how i2c bus sharing is supposed to work. This is an alternative to #392 . After the discussions there, I don't think we should split I2C into Bus and Device anymore. For SPI it makes sense, because drivers want to enforce that there's a CS pin (SpiDevice) or not (SpiBus). This is not the case with I2C, the API is exactly the same in the shared and non-shared case. Drivers shouldn't care which case it is.

So all we have to do to "support" bus sharing is docs, This PR does:

Dirbaio commented 1 year ago

Done

bors[bot] commented 1 year ago

Build succeeded: