Skip to content

Commit

Permalink
feat: Added sleep/wake methods to display
Browse files Browse the repository at this point in the history
  • Loading branch information
xgroleau committed Oct 3, 2023
1 parent 0dac848 commit 64174b3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mipidsi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,19 @@ where
self.dcs
.write_command(dcs::SetTearingEffect(tearing_effect))
}

///
/// Puts the display to sleep, reducing power consumption.
/// Need to call [Self::wake] before issuing other commands
///
pub fn sleep(&mut self) -> Result<(), Error> {
self.dcs.write_command(dcs::EnterSleepMode)
}

///
/// Wakes the display after it's been set to sleep via [Self::sleep]
///
pub fn wake(&mut self) -> Result<(), Error> {
self.dcs.write_command(dcs::ExitSleepMode)
}
}

0 comments on commit 64174b3

Please sign in to comment.