Exemplo n.º 1
0
/*
 * Receive an ACK.
 *
 * returns	0 If acknowledged
 *		1 in case of an error
 */
int SkI2cRcvAck(
SK_IOC	IoC)	/* I/O Context */
{
	/*
	 * Received bit must be zero.
	 */
	return(SkI2cRcvBit(IoC) != 0);
}	/* SkI2cRcvAck */
Exemplo n.º 2
0
/*
 * Receive one byte and ack it.
 *
 * Return byte.
 */
int SkI2cRcvByte(
    SK_IOC	IoC,	/* I/O Context */
    int	Last)		/* Last Byte Flag */
{
    int	i;
    int	Byte = 0;

    for (i = 0; i < 8; i++) {
        Byte <<= 1;
        Byte |= SkI2cRcvBit(IoC);
    }

    if (Last) {
        SkI2cSndNAck(IoC);
    } else {
        SkI2cSndAck(IoC);
    }

    return(Byte);
}	/* SkI2cRcvByte */