Add missing (default?) parameters, just in case

This commit is contained in:
Corey Vixie 2020-03-29 16:42:55 -07:00
parent 3896c8f027
commit 908fb4d53e
2 changed files with 9 additions and 9 deletions

View File

@ -384,7 +384,7 @@ impl CommandsGeneral {
/// - SWRESET cannot be sent during SLPOUT
/// - (MIPI ONLY) Send a shutdown packet before SWRESET
pub fn software_reset() -> Result<Command, &'static str> {
Ok(Command::new(Self::SWRESET as u8))
Ok(Command::new(Self::SWRESET as u8).arg(0x01))
}
/// # SLEEP IN
///
@ -401,7 +401,7 @@ impl CommandsGeneral {
///
/// Normally, sleep state can be read with RDDST, but MISO must be connected.
pub fn sleep_mode_on() -> Result<Command, &'static str> {
Ok(Command::new(Self::SLPIN as u8))
Ok(Command::new(Self::SLPIN as u8).arg(0x02))
}
/// # SLEEP OUT
@ -412,7 +412,7 @@ impl CommandsGeneral {
/// data will be valid for the two frames before the command if Normal Mode
/// is active.
pub fn sleep_mode_off() -> Result<Command, &'static str> {
Ok(Command::new(Self::SLPOUT as u8))
Ok(Command::new(Self::SLPOUT as u8).arg(0x11))
}
/// # PARTIAL MODE ON
///
@ -473,7 +473,7 @@ impl CommandsGeneral {
///
/// NOTE: It's possible that this is the default value.
pub fn display_off() -> Result<Command, &'static str> {
Ok(Command::new(Self::DISPOFF as u8))
Ok(Command::new(Self::DISPOFF as u8).arg(0x28))
}
/// # DISPLAY ON
///
@ -481,7 +481,7 @@ impl CommandsGeneral {
/// and pasted the description for DISPOFF. At a guess, it should turn the
/// display back on.
pub fn display_on() -> Result<Command, &'static str> {
Ok(Command::new(Self::DISPON as u8))
Ok(Command::new(Self::DISPON as u8).arg(0x29))
}
/// # TEARING EFFECT LINE OFF
///

View File

@ -8,7 +8,7 @@ mod panel;
mod spi;
use instructions::{BK0Command2, BK1Command2, Command, Command2Selection, CommandsGeneral};
use panel::CVTRB;
use panel::TDOMode;
use spi::ST7701S;
/// ST7701S supports two kinds of RGB interface, DE mode (mode 1) and HV mode
@ -21,17 +21,17 @@ fn main() {
let mut CMD2: Command2Selection = Command2Selection::Disabled;
let mut display = ST7701S::new(String::from("/dev/spidev1.0"));
let mode = CVTRB;
let mode = TDOMode;
// SOFTWARE RESET
// 5ms delay
display.write_command(CommandsGeneral::software_reset());
thread::sleep(time::Duration::from_millis(5));
thread::sleep(time::Duration::from_millis(10));
// EXIT SLEEP MODE
// Variable delay (200ms is "safe")
display.write_command(CommandsGeneral::sleep_mode_off());
thread::sleep(time::Duration::from_millis(200));
thread::sleep(time::Duration::from_millis(300));
// ENTER BK0 COMMAND2 MODE
display.write_command(CommandsGeneral::set_command_2(Command2Selection::BK0));