mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
sidequest - add some accessors to axp2101 object
This commit is contained in:
parent
73a1714772
commit
34ae2011b2
1 changed files with 6 additions and 0 deletions
|
|
@ -213,6 +213,8 @@ impl Axp2101 {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_dcdc(&mut self, which: WhichDcDc) -> (f32, bool) { self.dcdc_v_dvm[which as usize] }
|
||||
|
||||
pub fn set_ldo(
|
||||
&mut self,
|
||||
i2c: &mut dyn I2cApi,
|
||||
|
|
@ -237,6 +239,10 @@ impl Axp2101 {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_ldo(&mut self, which: WhichLdo) -> (f32, bool) {
|
||||
(self.ldo_v[which as usize], self.ldo_ena[which as usize])
|
||||
}
|
||||
|
||||
fn encode_dcdc_ena(&self) -> u8 {
|
||||
let mut code = 0;
|
||||
for (i, &ena) in self.dcdc_ena.iter().enumerate() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue