/* Send data with special length in slave mode through the I2Cx peripheral.  */
void I2C_SlaveWrite(I2C_TypeDef *I2Cx, u8 *pBuf, u8 len)
/* Send data with special length in slave mode through the I2Cx peripheral.  */
void I2C_SlaveWrite(I2C_TypeDef *I2Cx, u8 *pBuf, u8 len)
{
	u8 cnt = 0;
	assert_param(IS_I2C_ALL_PERIPH(I2Cx));
	for(cnt = 0; cnt < len; cnt++) {
		while((I2Cx->IC_RAW_INTR_STAT & BIT_IC_RAW_INTR_STAT_RD_REQ) == 0);
		if (I2C_SLAVEWRITE_PATCH) {
			I2Cx->IC_CLR_RD_REQ;
		}
		while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFNF)) == 0);
		I2Cx->IC_DATA_CMD = (*pBuf++);
	}
	while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFE)) == 0);
}