MCPcopy Create free account
hub / github.com/FrameworkComputer/framework-system / set_charge_limit

Method set_charge_limit

framework_lib/src/chromium_ec/mod.rs:434–443  ·  view source on GitHub ↗
(&self, min: u8, max: u8)

Source from the content-addressed store, hash-verified

432 }
433
434 pub fn set_charge_limit(&self, min: u8, max: u8) -> EcResult<()> {
435 // Sending bytes manually because the Set command, as opposed to the Get command,
436 // does not return any data
437 let limits = &[ChargeLimitControlModes::Set as u8, max, min];
438 let data = self.send_command(EcCommands::ChargeLimitControl as u16, 0, limits)?;
439
440 util::assert_win_len(data.len(), 0);
441
442 Ok(())
443 }
444
445 /// Get charge limit in percent (min, max)
446 pub fn get_charge_limit(&self) -> EcResult<(u8, u8)> {

Callers 1

handle_charge_limitFunction · 0.80

Calls 2

assert_win_lenFunction · 0.85
send_commandMethod · 0.45

Tested by

no test coverage detected