Skip to main content

pamoja_i2c_command_part_new

Function pamoja_i2c_command_part_new 

Source
#[unsafe(no_mangle)]
pub extern "C" fn pamoja_i2c_command_part_new( address: u8, width: usize, ) -> *mut PamojaI2cPart
Expand description

Creates a part answering at one address that takes commands and has been given no replies yet. A write sends a command and any arguments after it; a read takes the reply that command left, once, padded with 0xFF; a read with no reply waiting is not acknowledged.

§Arguments

  • address - the 7-bit address it answers to.
  • width - how many bytes a command takes: two for Sensirion’s 16-bit commands.

§Returns

The part, which the caller releases with pamoja_i2c_part_free.