Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/interface/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ where
pub fn new(i2c: I2C, addr: u8) -> Self {
Self { i2c, addr }
}

/// Release i2c
pub fn release(self) -> I2C {
self.i2c
}
}

impl<I2C, CommE> DisplayInterface for I2cInterface<I2C>
Expand Down
10 changes: 10 additions & 0 deletions src/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ where
Ok(())
}

/// Set Display Off
pub fn off(&mut self) -> Result<(), DI::Error> {
Command::DisplayOn(false).send(&mut self.iface)
}

/// Set the position in the framebuffer of the display where any sent data should be
/// drawn. This method can be used for changing the affected area on the screen as well
/// as (re-)setting the start point of the next `draw` call.
Expand Down Expand Up @@ -167,4 +172,9 @@ where
pub fn set_contrast(&mut self, contrast: u8) -> Result<(), DI::Error> {
Command::Contrast(contrast).send(&mut self.iface)
}

/// Release iface
pub fn release(self) -> DI {
self.iface
}
}