mirror of
https://github.com/Feliix42/ssd1675.git
synced 2024-11-22 02:46: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
|
/// Not sleeping
|
||||||
Normal,
|
Normal,
|
||||||
/// Deep sleep with RAM preserved
|
/// Deep sleep with RAM preserved
|
||||||
Mode1,
|
PreserveRAM,
|
||||||
/// Deep sleep RAM not preserved
|
/// Deep sleep RAM not preserved
|
||||||
Mode2,
|
DiscardRAM,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum Command {
|
pub enum Command {
|
||||||
|
@ -233,8 +233,8 @@ impl Command {
|
||||||
DeepSleepMode(mode) => {
|
DeepSleepMode(mode) => {
|
||||||
let mode = match mode {
|
let mode = match mode {
|
||||||
self::DeepSleepMode::Normal => 0b00,
|
self::DeepSleepMode::Normal => 0b00,
|
||||||
self::DeepSleepMode::Mode1 => 0b01,
|
self::DeepSleepMode::PreserveRAM => 0b01,
|
||||||
self::DeepSleepMode::Mode2 => 0b11,
|
self::DeepSleepMode::DiscardRAM => 0b11,
|
||||||
};
|
};
|
||||||
|
|
||||||
pack!(buf, 0x10, [mode])
|
pack!(buf, 0x10, [mode])
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use hal;
|
use hal;
|
||||||
|
|
||||||
use command::{BufCommand, Command, DataEntryMode, IncrementAxis};
|
use command::{BufCommand, Command, DataEntryMode, DeepSleepMode, IncrementAxis};
|
||||||
use interface::DisplayInterface;
|
use interface::DisplayInterface;
|
||||||
|
|
||||||
// Max display resolution is 160x296
|
// Max display resolution is 160x296
|
||||||
|
@ -90,7 +90,6 @@ impl<I> Display<I> where I: DisplayInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn deep_sleep(&mut self) -> Result<(), I::Error> {
|
fn deep_sleep(&mut self) -> Result<(), I::Error> {
|
||||||
// TODO: Send DeepSleep command
|
Command::DeepSleepMode(DeepSleepMode::PreserveRAM).execute(&mut self.interface)
|
||||||
unimplemented!()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue