LibTiePie  0.9.16
Library for interfacing TiePie engineering instruments
Reading data

Description

Functions to read data from an I2C device.

Functions

bool8_t I2CRead (LibTiePieHandle_t hDevice, uint16_t wAddress, void *pBuffer, uint32_t dwSize, bool8_t bStop)
 Read data from a specified address on the I2C bus, using a specified I2C host. More...
 
bool8_t I2CReadByte (LibTiePieHandle_t hDevice, uint16_t wAddress, uint8_t *pValue)
 Read one byte from a specified address on the I2C bus, using a specified I2C host. More...
 
bool8_t I2CReadWord (LibTiePieHandle_t hDevice, uint16_t wAddress, uint16_t *pValue)
 Read one word from a specified address on the I2C bus, using a specified I2C host. More...
 

Function Documentation

bool8_t I2CRead ( LibTiePieHandle_t  hDevice,
uint16_t  wAddress,
void *  pBuffer,
uint32_t  dwSize,
bool8_t  bStop 
)

Read data from a specified address on the I2C bus, using a specified I2C host.

Parameters
[in]hDeviceA device handle identifying the I2C host.
[in]wAddressThe I2C address to read from.
[out]pBufferA pointer to the read buffer.
[in]dwSizeThe number of bytes to read.
[in]bStopIndicates whether an I2C stop is generated after the transaction, when BOOL8_TRUE, an I2C stop is generated, when BOOL8_FALSE not.
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.
See also
I2CReadByte
I2CReadWord
Since
0.4.0
bool8_t I2CReadByte ( LibTiePieHandle_t  hDevice,
uint16_t  wAddress,
uint8_t *  pValue 
)

Read one byte from a specified address on the I2C bus, using a specified I2C host.

An I2C stop is generated after the transaction.

Parameters
[in]hDeviceA device handle identifying the I2C host.
[in]wAddressThe I2C address to read from.
[out]pValueA pointer to the read buffer.
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.
See also
I2CRead
I2CReadWord
Since
0.4.0
bool8_t I2CReadWord ( LibTiePieHandle_t  hDevice,
uint16_t  wAddress,
uint16_t *  pValue 
)

Read one word from a specified address on the I2C bus, using a specified I2C host.

An I2C stop is generated after the transaction.

Parameters
[in]hDeviceA device handle identifying the I2C host.
[in]wAddressThe I2C address to read from.
[out]pValueA pointer to the read buffer.
Returns
BOOL8_TRUE if successful, BOOL8_FALSE otherwise.
Note
Bus data is regarded big endian and converted to host endianess.
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.
See also
I2CRead
I2CReadByte
Since
0.4.0