Skip to main content

pamoja_i2c_script_read

Function pamoja_i2c_script_read 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_i2c_script_read( script: *mut PamojaI2cScript, address: u8, reply: *const u8, len: usize, ) -> PamojaStatus
Expand description

Adds a step: the driver reads from the address and receives the reply, whose length is the length it must ask for.

§Arguments

  • script - the script.
  • address - the 7-bit address the read must come from.
  • reply - the bytes the part answers with.
  • len - how many.

§Returns

PamojaStatus::Ok, or PamojaStatus::InvalidArgument for a null argument.

§Safety

script must be a live handle or null, and reply must point to len readable bytes.