diff --git a/src/interface/i2c.rs b/src/interface/i2c.rs index 543cb3b..f3a0fa0 100644 --- a/src/interface/i2c.rs +++ b/src/interface/i2c.rs @@ -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 DisplayInterface for I2cInterface diff --git a/src/properties.rs b/src/properties.rs index c37b654..9e96336 100644 --- a/src/properties.rs +++ b/src/properties.rs @@ -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. @@ -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 + } }