User manual

I2C API reference
50 © 2007-2010 Analytica GmbH
I2CRead
I2CRead — Reads data from an I2C partner.
Syntax
#include <AnaGateDllI2C.h>
int I2CRead(int hHandle, unsigned short nSlaveAddress, const char *
pcBuffer, int nBufferLen);
Parameter
hHandle Valid access handle.
nSlaveAddress Slave address of the I2C partner. The slave address can represent a so-called 7-bit
or 10-bit address. (siehe Appendix B, I2C slave address formats).
pcBuffer Byte buffer in which the data received from the I2C partner is to be stored.
nBufferLen Number of bytes to read.
Return value
Returns Null if successful, or an error value otherwise (Appendix A, Return Codes).
Description
Reads data from an I2C partner. The user must ensure that the setup of the data buffer and the address
of the I2C partner are correct.
The R/W bit of the slave address does not have to be explicitly set by the user.
See also
I2CWrite