add explicit power-off command to display

This commit is contained in:
bunnie 2026-04-22 01:21:47 +08:00
parent d94041bfeb
commit 4a236cfd68
2 changed files with 7 additions and 0 deletions

View file

@ -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() {

View file

@ -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);