/* Master sends single byte through the I2Cx peripheral to detect slave device.  */
int I2C_MasterSendNullData_TimeOut(I2C_TypeDef *I2Cx, int address, u32 timeout_ms)
/* Master sends single byte through the I2Cx peripheral to detect slave device.  */
int I2C_MasterSendNullData_TimeOut(I2C_TypeDef *I2Cx, int address, u32 timeout_ms)
{
	u8 I2CTemp = (u8)(address<<1);
	I2C_MasterSendNullData(I2Cx, &I2CTemp, 0, 1, 0);
	DelayMs(timeout_ms);
	if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) {
		I2C_ClearAllINT(I2Cx);
		DelayUs(100);
		I2C_Cmd(I2Cx, DISABLE);
		I2C_Cmd(I2Cx, ENABLE);
		return -1;
	}
	return 0;
}