MCPcopy Index your code
hub / github.com/FrameworkComputer/framework-system / read_i16

Method read_i16

framework_lib/src/smart_battery.rs:795–802  ·  view source on GitHub ↗
(&self, ec: &CrosEc, addr: u16)

Source from the content-addressed store, hash-verified

793 }
794
795 fn read_i16(&self, ec: &CrosEc, addr: u16) -> EcResult<u16> {
796 let i2c_response = i2c_read(ec, self.i2c_port, self.i2c_addr >> 1, addr, 0x02)?;
797 i2c_response.is_successful()?;
798 Ok(u16::from_le_bytes([
799 i2c_response.data[0],
800 i2c_response.data[1],
801 ]))
802 }
803
804 /// Read a 32-bit value from a ManufacturerAccess block command (SMBus block format with length prefix)
805 fn read_i32(&self, ec: &CrosEc, addr: u16) -> EcResult<u32> {

Callers 1

collect_dataMethod · 0.80

Calls 2

i2c_readFunction · 0.85
is_successfulMethod · 0.80

Tested by

no test coverage detected