/* * Send one byte to the I2C device and wait for ACK. * * Return acknoleged status. */ int SkI2cSndByte( SK_IOC IoC, /* I/O Context */ int Byte) /* byte to send */ { int i; for (i = 0; i < 8; i++) { if (Byte & (1<<(7-i))) { SkI2cSndBit(IoC, 1); } else { SkI2cSndBit(IoC, 0); } } return(SkI2cRcvAck(IoC)); } /* SkI2cSndByte */
/* * Send an ACK. */ void SkI2cSndAck( SK_IOC IoC) /* I/O Context */ { /* * Received bit must be zero. */ SkI2cSndBit(IoC, 0); } /* SkI2cSndAck */