- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I am using Cypress PSoC 5LP for communicating with sensor over I2C Bus.
PSoC acts as master while sensor act as slave device.
PSoC sends read command to sensor. Sensor responds after 80ms with 3 Bytes reading.(Hold master SCK Line pull low)
I am getting the data properly without any error.
Stat = I2C_MasterReadBuf(DeviceAddress, pBuffer, NumBytes, I2C_MODE_COMPLETE_XFER);
if(Stat == I2C_MSTR_NO_ERROR)
{
while (0u == (I2C_MasterStatus() & I2C_MSTAT_RD_CMPLT))
{
/* Waits until master completes Read operation */
}
}
As per the code snippet master polls in while loop for almost 80ms till data comes.
How can I avoid this polling?
Is there is any other API which tells when data is available now read it?
Thanks & Regards,
Pratik Pawar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum, Patrik.
What do you want to do in that 80 ms? Go ahead and do it, then check again for transmission completed.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum, Patrik.
What do you want to do in that 80 ms? Go ahead and do it, then check again for transmission completed.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks Bob for Reply.
I was calling mentioned I2C API in an structured software functions. I was passing address of the local buffer to receive I2C message. Now I am going to implement with Global buffer. So that message will be stored & I can used it later point of time.
In that 80ms I want to listen messages on UART also.
Thanks again 🙂
Pratik