use crate::driver::aw9523b::{Aw9523bDriver, Aw9523bResources};
use crate::driver::axp2101::Axp2101Driver;
use crate::io::shared_i2c::SharedI2cBus;
const AXP2101_ADDR: u8 = 0x34;
const BACKLIGHT_MV: u16 = 3300;
pub async fn power_display_reset(i2c: &'static SharedI2cBus) {
let mut aw = Aw9523bDriver::new(Aw9523bResources { i2c });
if let Err(e) = aw.init().await {
error!("AW9523B init failed: {:?}", e);
}
if let Err(e) = aw.lcd_rst_pulse().await {
error!("AW9523B LCD RST failed: {:?}", e);
}
if let Err(e) = aw.touch_rst_pulse().await {
error!("AW9523B TOUCH RST failed: {:?}", e);
}
let mut axp = Axp2101Driver::new(i2c, AXP2101_ADDR);
if let Err(e) = axp.set_dldo1(true, BACKLIGHT_MV).await {
error!("AXP2101 backlight enable failed: {:?}", e);
}
}