NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
long I2CWrite ( const byte  port,
byte  retlen,
byte  buffer[] 
)
inline

Write I2C data.

This method starts a transaction to write the bytes contained in the array buffer to the I2C device on the specified port. It also tells the I2C device the number of bytes that should be included in the response. The maximum number of bytes that can be written or read is 16.

Parameters
portThe port to which the I2C device is attached. See the Input port constants group. You may use a constant or a variable. Constants should be used where possible to avoid blocking access to I2C devices on other ports by code running on other threads.
retlenThe number of bytes that should be returned by the I2C device.
bufferA byte array containing the address of the I2C device, the I2C device register at which to write data, and up to 14 bytes of data to be written at the specified register.
Returns
A status code indicating whether the write completed successfully or not. See CommLSWriteType for possible result values. If the return value is NO_ERR then the last operation did not cause any errors.
See Also
I2CCheckStatus, I2CRead, I2CStatus, I2CBytesReady, LowspeedRead, LowspeedWrite, LowspeedCheckStatus, LowspeedBytesReady, and LowspeedStatus
Examples:
ex_I2CWrite.nxc.