mirror of
https://github.com/laanwj/k210-sdk-stuff.git
synced 2024-11-22 09:26:21 +04:00
rust: Add LCD shutdown function
This commit is contained in:
parent
9e6c9f5a8f
commit
8806f01455
@ -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<X: SPI> 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;
|
||||
|
Loading…
Reference in New Issue
Block a user