WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

transfer

Performs a complete communication with a slave device to write a number of bytes and then read a number of bytes.
The return value specifies if it was successful (TRUE) or not (FALSE).
Syntax
I2cDevice. transfer(writeLen,writeData,responseLen,response)
Where I2cDevice is the name you have given to the device in Project Designer.
Parameters
TypeNameDescription
'writeLen'
The number of bytes to be written.
'writeData'
The memory address of the data to be written.
'responseLen'
The number of bytes to be received.
'response'
The memory address to store the returned the values.
Returns
boolean
Note
This is the same as the following pseudo code:
// Connect in write mode
i2cStart( WRITE );
// Write the data
for(int i=0; i<writeLen; i++){
    i2cPut( writeData[writeLen] );
}
// Connect in read mode
i2cStart( READ );
// Read response
for(int i=0; i<responseLen; i++){
    response[i] = i2cGet();
}
// Hang up
i2cStop();

 

 

Valid XHTML 1.0 Transitional