Skip to main content

pamoja_i2c_bus_write

Function pamoja_i2c_bus_write 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_i2c_bus_write( bus: *const PamojaI2cBus, address: u8, bytes: *const u8, len: usize, ) -> PamojaStatus
Expand description

Writes bytes to a part, in one transaction.

§Arguments

  • bus - the bus.
  • address - the part’s 7-bit address.
  • bytes - what to write, usually a register address and then its value.
  • len - how many bytes.

§Returns

PamojaStatus::Ok; PamojaStatus::InvalidArgument for a null argument; or PamojaStatus::Io when the transfer fails, with the reason in the last error message.

§Safety

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