Skip to content

Commit

Permalink
use unsafe getter
Browse files Browse the repository at this point in the history
  • Loading branch information
almindor committed Jan 13, 2024
1 parent ef26681 commit e48f1da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 1 addition & 4 deletions mipidsi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- added `Display::wake` method
- added `Display::sleep` method
- added `Display::is_sleeping` method

### Changed

- exposed `Display::dcs` to allow sending custom DCS commands to the device
- added `Display::dcs` method to allow sending custom DCS commands to the device

## [v0.7.1] - 2023-05-24

Expand Down
12 changes: 10 additions & 2 deletions mipidsi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ where
MODEL: Model,
RST: OutputPin,
{
/// DCS provider, can be used directly to send custom DCS commands to the device
pub dcs: Dcs<DI>,
// DCS provider
dcs: Dcs<DI>,
// Model
model: MODEL,
// Reset pin
Expand Down Expand Up @@ -289,4 +289,12 @@ where
self.sleeping = false;
Ok(())
}

///
/// Returns the DCS interface for sending raw commands.
/// *WARNING*: user is responsible for ensuring display state validity
///
pub unsafe fn dcs(&mut self) -> &mut Dcs<DI> {
&mut self.dcs
}
}

0 comments on commit e48f1da

Please sign in to comment.