LibTiePie  0.9.8
Library for interfacing TiePie engineering instruments
Writing data

Description

Functions to write data to an I2C device.

Functions

bool8_t I2CWrite (LibTiePieHandle_t hDevice, uint16_t wAddress, const void *pBuffer, uint32_t dwSize, bool8_t bStop)
 Write data to a specified address on the I2C bus, using a specified I2C host. More...
 
bool8_t I2CWriteByte (LibTiePieHandle_t hDevice, uint16_t wAddress, uint8_t byValue)
 Write one byte to a specified address on the I2C bus, using a specified I2C host. More...
 
bool8_t I2CWriteByteByte (LibTiePieHandle_t hDevice, uint16_t wAddress, uint8_t byValue1, uint8_t byValue2)
 Write two bytes to a specified address on the I2C bus, using a specified I2C host. More...
 
bool8_t I2CWriteByteWord (LibTiePieHandle_t hDevice, uint16_t wAddress, uint8_t byValue1, uint16_t wValue2)
 Write one byte and one word to a specified address on the I2C bus, using a specified I2C host. More...
 
bool8_t I2CWriteWord (LibTiePieHandle_t hDevice, uint16_t wAddress, uint16_t wValue)
 Write one word to a specified address on the I2C bus, using a specified I2C host. More...
 

Function Documentation

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

Write data to 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 write to.
[in]pBufferA pointer to the write buffer.
[in]dwSizeThe number of bytes to write.
[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
I2CWriteByte
I2CWriteByteByte
I2CWriteByteWord
I2CWriteWord
Since
0.4.0
bool8_t I2CWriteByte ( LibTiePieHandle_t  hDevice,
uint16_t  wAddress,
uint8_t  byValue 
)

Write one byte to 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 write to.
[in]byValueThe byte value to write.
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
I2CWrite
I2CWriteByteByte
I2CWriteByteWord
I2CWriteWord
Since
0.4.0
bool8_t I2CWriteByteByte ( LibTiePieHandle_t  hDevice,
uint16_t  wAddress,
uint8_t  byValue1,
uint8_t  byValue2 
)

Write two bytes to 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 write to.
[in]byValue1The first byte value to write.
[in]byValue2The second byte value to write.
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
I2CWrite
I2CWriteByte
I2CWriteByteWord
I2CWriteWord
Since
0.4.0
bool8_t I2CWriteByteWord ( LibTiePieHandle_t  hDevice,
uint16_t  wAddress,
uint8_t  byValue1,
uint16_t  wValue2 
)

Write one byte and one word to 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 write to.
[in]byValue1The byte value to write.
[in]wValue2The word value to write.
Returns
BOOL8_TRUE if successful, BOOL8_FALSE otherwise.
Note
Bus data is regarded big endian, host endian data will be converted to big endian.
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
I2CWrite
I2CWriteByte
I2CWriteByteByte
I2CWriteWord
Since
0.4.0
bool8_t I2CWriteWord ( LibTiePieHandle_t  hDevice,
uint16_t  wAddress,
uint16_t  wValue 
)

Write one word to 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 write to.
[in]wValueThe word value to write.
Returns
BOOL8_TRUE if successful, BOOL8_FALSE otherwise.
Note
Bus data is regarded big endian, host endian data will be converted to big endian.
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
I2CWrite
I2CWriteByte
I2CWriteByteByte
I2CWriteByteWord
Since
0.4.0