sub_i2c_write

Top  Previous  Next
Got to SUB-20 page

Synopsis

int sub_i2c_write( sub_handle hndl, int sa, int ma, int ma_sz,

                                                                 char* buf, int sz )

 

Perform complete I2C master write transaction with optional memory address write. Transaction will have following format:

 

sub_i2c_write

 

If ma_sz is zero "Memory Address Write" stage will be skipped.

Function has no limitation of the write data size - sz parameter. However internal organization of the I2C slave device being written should be considered especially Acknowledge Polling and EEPROM Page Write.

Parameters

sa - Slave Address

ma - Memory Address. Will be shifted out in "Memory Address Write" stage MSB first

ma_sz - Memory Address size bytes

buf - Buffer for data to be written

sz - Write data size bytes

Return value

On success function returns 0. Otherwise error code.

See also

Error Codes, I2C Status