/**
 * @brief	Handle I2C1 interrupt by calling I2CM interrupt transfer handler
 * @return	Nothing
 */
void LPC_I2C_INTHAND(void)
{
	uint32_t state = Chip_I2C_GetPendingInt(LPC_I2C_PORT);

	
	/* I2C slave related interrupt */
	while (state & (I2C_INTENSET_SLVPENDING | I2C_INTENSET_SLVDESEL)) {
		Chip_I2CS_XferHandler(LPC_I2C_PORT, &i2csCallBacks);

		/* Update state */
		state = Chip_I2C_GetPendingInt(LPC_I2C_PORT);
	}
}
/****************************************************************************************************
 * @fn      i2c_slave_receive
 *          This function handles data transfer from host. Currently this function is being called
 *          from IRQ handler
 *
 * @param   obj - reference to the i2c slave data structure
 *
 * @return  none
 *
 ***************************************************************************************************/
int i2c_slave_receive( i2c_t *obj )
{
    obj->i2c_operation = 0; /* reset current i2c operation status */
    Chip_I2CS_XferHandler(I2C_HOSTIF, &i2cs_HostIfCallBacks);
    return obj->i2c_operation;
}