Skip to content
Ken Sharp edited this page Dec 8, 2023 · 1 revision

I2cWrite()

Write data to the specified I2C bus.

Syntax

I2cWrite(unsigned char channel, unsigned char slaveAddress, unsigned char eofConfig, unsigned char numBytes, unsigned char* sendBuffer);

channel
The I2C master channel to open.

slaveAddress
The 7-bit slave address of the I2C device to write to. The R/W bit will be set automatically.

eofConfig
End of frame configuration:

  • 0 - EOF_STOP - Stop
  • 1 - EOF_RESTART - Stop and restart
  • 2 - EOF_RESTART_NOSTOP - Restart with no stop
  • 3 - EOF_NOSTOP - No stop

numBytes
The number of bytes to write to the I2C channel.

sendBuffer
A pointer to the first element in a byte array which contains the data to write to the I2C bus.

Returns

int status

Related Links

Clone this wiki locally