beautypg.com

HID Hi-O iCLASS Installation Guide User Manual

Page 37

background image

iCLASS OEM75 Integration Guide, 3141-907, Rev. B.0

January 2014

Page 37 of 49

HID GLOBAL CONFIDENTIAL AND/OR PROPRIETARY INFORMATION. This document contains confidential and/or proprietary

information, which may not be duplicated, published, disseminated or disclosed, or used for any purpose, without the written

consent of HID Global Corporation. If you are an unintended recipient of this information or are unwilling to accept the above

restrictions, please immediately return this document to HID Global Corporation, 15370 Barranca Pkwy, Irvine, CA 92618-3106.

for (cnt = 0; cnt < numBytes; cnt++)

{

if (I²C_NAK == writeByte(pData[cnt]))

{

cnt = numBytes; // end the loop

}

}

}

}

sendI2CStop();

}

/***********************************************************************

** NAME:

** ReadI2C

**

** INPUTS:

** None

**

** OUTPUTS:

** pData - points to the buffer to store the incoming message data

** pNumBytes - points to the location to store the number of bytes received

**

** RETURN:

** None

**

** DESCRIPTION:

** This function receives a byte of data from an external CPU or

** peripheral device.

**

** NOTES:

**

***********************************************************************/

void ReadI2C(UBYTE *pData, UBYTE *pNumBytes)

{

UBYTE cnt;

//

// Issue a bus start

//

sendI2CStart();

//

// Send device address with the read bit set.

//

if (I2C_NAK == writeByte(SLAVE_ADDR | 0x01))

{

return;

}

//

// Read the first byte in the message. This byte is

// the number of bytes that is to be received in the

// incoming message.

//