rust-embedded / embedded-hal

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

Add bus access methods to `ExclusiveDevice` #473

Closed bugadani closed 1 year ago

bugadani commented 1 year ago

Closes #467

I've chosen bus and bus_mut instead of inner{_mut} because ExclusiveDevice also wraps CS and Delay, so "inner" isn't very descriptive here. I've also opted to not implement into_inner for the same reason, and because a destructuring conversion would need to return both the bus, the chip select and the delay, too. So in summary, this PR is the minimal, hopefully non-controversial subset of additions.