IOI2CRequest

A structure defining an I2C bus transaction.

Declaration

struct IOI2CRequest {
   IOOptionBits sendTransactionType;
   IOOptionBits replyTransactionType;
   uint32_t sendAddress;
   uint32_t replyAddress;
   uint8_t sendSubAddress;
   uint8_t replySubAddress;
   uint8_t __reservedA[2];
   uint64_t minReplyDelay;
   IOReturn result;
   IOOptionBits commFlags;
   #if defined(__LP64__)
   uint32_t __padA;
   #else
   vm_address_t sendBuffer;
   #endif
   uint32_t sendBytes;
   uint32_t __reservedB[2];
   #if defined(__LP64__)
   uint32_t __padB;
   #else
   vm_address_t replyBuffer;
   #endif
   uint32_t replyBytes;
   IOI2CRequestCompletion completion;
   #if !defined(__LP64__)
   uint32_t __padC[5];
   #else
   vm_address_t sendBuffer;
   vm_address_t replyBuffer;
   #endif
   uint32_t __reservedC[10];
   #ifdef __ppc__
   uint32_t __reservedD;
   #endif
};

Overview

This structure is used to request an I2C transaction consisting of a send (write) to and reply (read) from a device, either of which is optional, to be carried out atomically on an I2C bus.

Topics

Fields

__reservedA

Set to zero.

result

The result of the transaction. Common errors are kIOReturnNoDevice if there is no device responding at the given address, kIOReturnUnsupportedMode if the type of transaction is unsupported on the requested bus.

completion

A completion routine to be executed when the request completes. If NULL is passed, the request is synchronous, otherwise it may execute asynchronously.

commFlags

Flags that modify the I2C transaction type.

minReplyDelay

Minimum delay as absolute time between send and reply transactions.

sendAddress

I2C address to write.

sendSubAddress

I2C subaddress to write.

__reservedB

Set to zero.

sendTransactionType

Specifies one of three possible transaction types.

sendBuffer

Pointer to the send buffer.

sendBytes

Number of bytes to send. Set to actual bytes sent on completion of the request.

replyAddress

I2C Address from which to read.

replySubAddress

I2C Address from which to read.

__reservedC

Set to zero.

replyTransactionType

Specifies one of four possible reply transaction types.

replyBuffer

Pointer to the reply buffer.

replyBytes

Max bytes to reply (size of replyBuffer). Set to actual bytes received on completion of the request.

__reservedD

Set to zero.