add get dcdc routine to axp2101 api

This commit is contained in:
bunnie 2025-08-19 19:01:03 +08:00
parent 29b524375b
commit bdd8b727a7

View file

@ -213,7 +213,9 @@ impl Axp2101 {
}
}
pub fn get_dcdc(&mut self, which: WhichDcDc) -> (f32, bool) { self.dcdc_v_dvm[which as usize] }
pub fn get_dcdc(&mut self, which: WhichDcDc) -> Option<(f32, bool)> {
if self.dcdc_ena[which as usize] { Some(self.dcdc_v_dvm[which as usize]) } else { None }
}
pub fn set_ldo(
&mut self,