diff --git a/src/mode/graphics.rs b/src/mode/graphics.rs index 15642fb..44b1d2d 100644 --- a/src/mode/graphics.rs +++ b/src/mode/graphics.rs @@ -192,6 +192,11 @@ where pub fn set_contrast(&mut self, contrast: u8) -> Result<(), DI::Error> { self.properties.set_contrast(contrast) } + + /// Power on/off the display + pub fn power(&mut self, on: bool) -> Result<(), DI::Error> { + self.properties.power(on) + } } #[cfg(feature = "graphics")] diff --git a/src/properties.rs b/src/properties.rs index c37b654..d48629e 100644 --- a/src/properties.rs +++ b/src/properties.rs @@ -167,4 +167,9 @@ where pub fn set_contrast(&mut self, contrast: u8) -> Result<(), DI::Error> { Command::Contrast(contrast).send(&mut self.iface) } + + /// Power on/off the display + pub fn power(&mut self, on: bool) -> Result<(), DI::Error> { + Command::DisplayOn(on).send(&mut self.iface) + } }