mirror of
https://github.com/Feliix42/ssd1675.git
synced 2024-11-21 18:36:30 +00:00
Implement deep_sleep on Display
This commit is contained in:
parent
2b24889e83
commit
071a014ac1
2 changed files with 6 additions and 7 deletions
|
@ -45,9 +45,9 @@ pub enum DeepSleepMode {
|
|||
/// Not sleeping
|
||||
Normal,
|
||||
/// Deep sleep with RAM preserved
|
||||
Mode1,
|
||||
PreserveRAM,
|
||||
/// Deep sleep RAM not preserved
|
||||
Mode2,
|
||||
DiscardRAM,
|
||||
}
|
||||
|
||||
pub enum Command {
|
||||
|
@ -233,8 +233,8 @@ impl Command {
|
|||
DeepSleepMode(mode) => {
|
||||
let mode = match mode {
|
||||
self::DeepSleepMode::Normal => 0b00,
|
||||
self::DeepSleepMode::Mode1 => 0b01,
|
||||
self::DeepSleepMode::Mode2 => 0b11,
|
||||
self::DeepSleepMode::PreserveRAM => 0b01,
|
||||
self::DeepSleepMode::DiscardRAM => 0b11,
|
||||
};
|
||||
|
||||
pack!(buf, 0x10, [mode])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use hal;
|
||||
|
||||
use command::{BufCommand, Command, DataEntryMode, IncrementAxis};
|
||||
use command::{BufCommand, Command, DataEntryMode, DeepSleepMode, IncrementAxis};
|
||||
use interface::DisplayInterface;
|
||||
|
||||
// Max display resolution is 160x296
|
||||
|
@ -90,7 +90,6 @@ impl<I> Display<I> where I: DisplayInterface {
|
|||
}
|
||||
|
||||
fn deep_sleep(&mut self) -> Result<(), I::Error> {
|
||||
// TODO: Send DeepSleep command
|
||||
unimplemented!()
|
||||
Command::DeepSleepMode(DeepSleepMode::PreserveRAM).execute(&mut self.interface)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue