Skip to content

Commit 6e8bd14

Browse files
authored
Merge pull request #473 from bugadani/bus
Add bus access methods to `ExclusiveDevice`
2 parents 27be7bc + 93a5011 commit 6e8bd14

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

embedded-hal-async/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
### Added
11+
- spi: added `ExclusiveDevice::{bus, bus_mut}`.
12+
1013
## [v0.2.0-alpha.2] - 2023-07-04
1114

1215
### Added

embedded-hal-async/src/spi.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,16 @@ impl<BUS, CS, D> ExclusiveDevice<BUS, CS, D> {
208208
pub fn new(bus: BUS, cs: CS, delay: D) -> Self {
209209
Self { bus, cs, delay }
210210
}
211+
212+
/// Returns a reference to the underlying bus object.
213+
pub fn bus(&self) -> &BUS {
214+
&self.bus
215+
}
216+
217+
/// Returns a mutable reference to the underlying bus object.
218+
pub fn bus_mut(&mut self) -> &mut BUS {
219+
&mut self.bus
220+
}
211221
}
212222

213223
impl<BUS, CS, D> ErrorType for ExclusiveDevice<BUS, CS, D>

0 commit comments

Comments
 (0)