|
|
|
|
@ -151,4 +151,19 @@ impl Command {
|
|
|
|
|
pub fn addr(self) -> u8 { |
|
|
|
|
self as u8 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(test)] |
|
|
|
|
mod tests { |
|
|
|
|
use super::*; |
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
fn command_addr() { |
|
|
|
|
assert_eq!(Command::POWER_SAVING.addr(), 0xE3); |
|
|
|
|
|
|
|
|
|
assert_eq!(Command::PANEL_SETTING.addr(), 0x00); |
|
|
|
|
|
|
|
|
|
assert_eq!(Command::DISPLAY_REFRESH.addr(), 0x12);
|
|
|
|
|
} |
|
|
|
|
} |