I2C_WriteRandom

The function I2C_WriteRandom writes one byte to a given i2c-address.

void I2C_WriteRandom( UCHAR SlaveAddress, UCHAR SubAddress, UCHAR data ); void i2c_RandomByteWrite( UCHAR SlaveAddress, UCHAR SubAddress, UCHAR data );

Parameters

SlaveAddress Slave-Address of the i2c-device.

SubAddress Sub-Address of the i2c-device.

data Data to be written to the i2c-device.

Remarks

Issues following sequence:

  • Lock

  • Start

  • SlaveAddress with write-bit

  • SubAddress

  • Write data

  • Stop

  • Unlock

This function calls I2C_Lock and I2C_Unlock to prevent multiple accesses to the i2c-bus. Don't lock access to i2c-bus prior to using this function!!

Requirements

OS Versions: Windows CE 4.2 and later.
Header: drvlib_app.h
Link Library: drvlib_app.lib

See Also

I2C_ReadRandom