HID Hi-O iCLASS Installation Guide User Manual
Page 42

iCLASS OEM75 Integration Guide, 3141-907, Rev. B.0
Page 42 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.
***********************************************************************/
static UBYTE writeByte (UBYTE data)
{
SSP1BUF = data;
CLRWDT();
while (RW1 || BF1) ;
if (ACKSTAT1)
{
return I2C_NAK;
}
return I2C_ACK;
} /* writeByte */
/***********************************************************************
** NAME:
** readByte
**
** INPUTS:
** None
**
** OUTPUTS:
** None
**
** RETURN:
** None
**
** DESCRIPTION:
** Reads a byte from the I²C.
**
** NOTES:
**
***********************************************************************/
static UBYTE readByte (void)
{
UBYTE I2CByte;
RCEN1 = 1;
CLRWDT();
while (RCEN1) ;
I²CByte = SSP1BUF;
return I2CByte;
} /* readByte */