mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
add explicit power-off command to display
This commit is contained in:
parent
d94041bfeb
commit
4a236cfd68
2 changed files with 7 additions and 0 deletions
|
|
@ -60,6 +60,8 @@ pub mod rtc;
|
|||
pub mod sigcheck;
|
||||
#[cfg(not(feature = "hosted-baosec"))]
|
||||
pub mod sram_trim;
|
||||
#[cfg(not(feature = "hosted-baosec"))]
|
||||
pub mod wdt;
|
||||
|
||||
#[inline(always)]
|
||||
pub fn cache_flush() {
|
||||
|
|
|
|||
|
|
@ -532,6 +532,11 @@ impl<'a> Oled128x128<'a> {
|
|||
|
||||
pub fn powerdown(&mut self) {
|
||||
self.powerdown = true;
|
||||
let powoff = [Command::DisplayOnOff(DisplayState::Off)];
|
||||
for command in powoff {
|
||||
let bytes = command.encode();
|
||||
self.send_command(bytes).ok();
|
||||
}
|
||||
// assert reset
|
||||
crate::board::assert_periph_reset(self.iox, true);
|
||||
self.iox.set_gpio_pin_value(self.cd_port, self.cd_pin, IoxValue::Low);
|
||||
|
|
|
|||
Loading…
Reference in a new issue