beautypg.com

HID Hi-O iCLASS Installation Guide User Manual

Page 30

background image

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

Page 30 of 49

January 2014

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.

// Send the WRITE SPI byte.

sendSpiByte(SPI_WRITE, &returnByte);

// Send the number of bytes in this transfer.

sendSpiByte(numBytes, &returnByte);

// Send the data.

for (cnt=0; cnt

{

sendSpiByte(pData[cnt], &returnByte);

}

// De-Select the SPI slave device.

OEM75_SS = 1;

}

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

** NAME:

** ReadSpi

**

** INPUTS:

** None

**

** OUTPUTS:

** pData - points to location to store incoming message data

** pNumBytes – points to location to store number of bytes in the message

**

** RETURN:

** None

**

** DESCRIPTION:

** This function receives a message from a slave SPI.

**

** NOTES:

**

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

void ReadSpi(UBYTE *pData, UBYTE *pNumBytes)

{

UBYTE cnt;

// Select the SPI slave device.

OEM75_SS = 0;

// Send the Read command.

sendSpiByte(SPI_READ, pNumBytes);

// Send a dummy data byte and store the number of

// available bytes that is returned.

sendSpiByte(SPI_READ, pNumBytes);

for (cnt=0; cnt<=*pNumBytes; cnt++)

{

sendSpiByte(0, &pData[cnt]);

}

// De-Select the SPI slave devices.

OEM75_SS = 1;