LibTiePie  0.9.8
Library for interfacing TiePie engineering instruments
Writing/reading data

Description

Functions to write and read data to/from an I2C device.

Functions

bool8_t I2CWriteRead (LibTiePieHandle_t hDevice, uint16_t wAddress, const void *pWriteBuffer, uint32_t dwWriteSize, void *pReadBuffer, uint32_t dwReadSize)
 Write and read data to/from to a specified address on the I2C bus, using a specified I2C host. More...
 

Function Documentation

bool8_t I2CWriteRead ( LibTiePieHandle_t  hDevice,
uint16_t  wAddress,
const void *  pWriteBuffer,
uint32_t  dwWriteSize,
void *  pReadBuffer,
uint32_t  dwReadSize 
)

Write and read data to/from to a specified address on the I2C bus, using a specified I2C host.

Equivalent:

1 I2CWrite( hDevice , wAddress , pWriteBuffer , dwWriteSize , BOOL8_FALSE ) &&
2 I2CRead( hDevice , wAddress , pReadBuffer , dwReadSize , BOOL8_TRUE );
Parameters
[in]hDeviceA device handle identifying the I2C host.
[in]wAddressThe I2C address to write to.
[in]pWriteBufferA pointer to the write buffer.
[in]dwWriteSizeThe number of bytes to write.
[out]pReadBufferA pointer to the read buffer.
[in]dwReadSizeThe number of bytes to read.
Returns
BOOL8_TRUE if successful, BOOL8_FALSE otherwise.
Status values
INTERNAL_ADDRESS The requested I2C address is an internally used address in the device.
BIT_ERROR The requested I2C operation generated a bit error.
NO_ACKNOWLEDGE The requested I2C operation generated "No acknowledge".
INVALID_HANDLE The handle is not a valid I2C host handle.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
Since
0.6