Question
what does the line 6 wait do?
void sEE_ReadBuffer(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t* NumByteToRead)
{
//__IO uint32_t timeout = 0xFFFF;
__IO uint32_t timeout = 0xf00;
/*!< Wait the end of last communication */
for (;timeout > 0; timeout--);
/* Set the pointer to the Number of data to be read. This pointer will be used
by the DMA Transfer Complete interrupt Handler in order to reset the
variable to 0. User should check on this variable in order to know if the
DMA transfer has been completed or not. */
sEEDataReadPointer = NumByteToRead;
/*!< While the bus is busy */
while (I2C_GetFlagStatus(sEE_I2C, I2C_FLAG_BUSY))
{}
/*!< Send START condition */
I2C_GenerateSTART(sEE_I2C, ENABLE);
/*!< Test on EV5 and clear it */
while (!I2C_CheckEvent(sEE_I2C, I2C_EVENT_MASTER_MODE_SELECT))
{}
}