/* Set/clear i2c slave NAK or ACK data part in transfer.  */
int i2c_slave_set_for_data_nak(i2c_t *obj, int set_nak)
/* Set/clear i2c slave NAK or ACK data part in transfer.  */
int i2c_slave_set_for_data_nak(i2c_t *obj, int set_nak)
{
	I2C_TypeDef * I2Cx = obj->I2Cx;
	u32 temp;
	while (1) {
		temp = I2Cx->IC_STATUS;
		if ((BIT_IC_STATUS_SLV_ACTIVITY & temp) == 0) {
			break;
		}
	}
	I2Cx->IC_SLV_DATA_NACK_ONLY = set_nak;
        return 0;
}