/* Send data with special length in slave mode through the USIx peripheral.  */
void USI_I2C_SlaveWrite(USI_TypeDef *USIx, u8 *pBuf, u8 len)
/* Send data with special length in slave mode through the USIx peripheral.  */
void USI_I2C_SlaveWrite(USI_TypeDef *USIx, u8 *pBuf, u8 len)
{
	u8 cnt = 0;
	assert_param(IS_USI_I2C_ALL_PERIPH(USIx));
	for(cnt = 0; cnt < len; cnt++) {
		while((USI_I2C_GetRawINT(USIx) & USI_I2C_RD_REQ_RSTS) == 0);
		if (USI_I2C_SLAVEWRITE_PATCH) {
			USIx->INTERRUPT_STATUS_CLR =  USI_I2C_RD_REQ_CLR;
		}
		while((USI_I2C_CheckTXFIFOState(USIx, USI_TXFIFO_ALMOST_EMPTY_COPY)) == 0);
		USIx->TX_FIFO_WRITE = (*pBuf++);
	}
	while((USI_I2C_CheckTXFIFOState(USIx, USI_TXFIFO_EMPTY)) == 0);
}