gf_i2c_read()

Perform an I2C master-read transaction

Synopsis:

#include <gf/gf.h>

int gf_i2c_read ( gf_dev_t      gdev,
                  int           busno,
                  int           slaveaddr,
                  uint8_t *     idata,
                  int           ibytes );

Arguments:

gdev
The handle for the graphics device to peform the transaction on. This is the handle acquired by gf_dev_attach().
busno
Index of the I2C bus, on which this device is capable of being a master.
slaveaddr
The address of the I2C slave device.
idata
A pointer to a buffer where the function can store the incoming data.
ibytes
The number of bytes to read. The maximum is 128 bytes.

Library:

gf

Description:

This function performs an I2C master-read transaction.


WARNING: Threads should not call this function between calls to gf_draw_begin() and gf_draw_end(), or a deadlock will occur.

Returns:

GF_ERR_OK
Success.
GF_ERR_PARM
The busno index is out of range for the specified device.
GF_ERR_IODISPLAY
Error communicating with io-display. Check to ensure that io-display is still running. The sloginfo utility may provide more information.
GF_ERR_IO
Hardware error reading from the slave device. The sloginfo utility may provide more information.
GF_ERR_TOOBIG
The number of bytes requested to be read (ibytes) is larger than the maximum of 128.

Classification:

QNX Graphics Framework

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

gf_i2c_write(), gf_i2c_writeread()