From 8806f01455bd774c57415618d97833c475466336 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 7 Feb 2020 18:01:02 +0000 Subject: [PATCH] rust: Add LCD shutdown function --- rust/k210-shared/src/board/lcd.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rust/k210-shared/src/board/lcd.rs b/rust/k210-shared/src/board/lcd.rs index b5d182e..f2f4495 100644 --- a/rust/k210-shared/src/board/lcd.rs +++ b/rust/k210-shared/src/board/lcd.rs @@ -147,6 +147,7 @@ pub trait LCDHL { fn set_direction(&mut self, dir: direction); fn clear(&self, color: u16); fn draw_picture(&self, x1: u16, y1: u16, width: u16, height: u16, data: &[u32]); + fn shutdown(&mut self); } impl<'a, X: SPI> LCD<'a, X> { @@ -327,6 +328,10 @@ impl LCDHL for LCD<'_, X> { self.write_command(command::DISPLAY_ON); } + fn shutdown(&mut self) { + self.set_rst(false); + } + fn set_direction(&mut self, dir: direction) { if ((dir as u8) & DIR_XY_MASK) != 0 { self.width = LCD_Y_MAX;