- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Did not find a clear answer in the FX3 API guide, but are API calls like
CyU3PI2cSetConfig()
CyU3PI2cReceiveBytes()
CyU3PI2cTransmitBytes()
CyU3PUartSetConfig()
...
made thread safe, meaning can we call them from several ThreadX OS tasks or must we avoid doing that?
Looking forward to your feedback.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
We do not recommend you to use the APIs from two different threads. Consider I2C example. If you have added CyU3PI2cTransmitBytes() API in thread 1 and CyU3PI2cReceiveBytes() API in thread 2, and if thread 1 starts first. Then CyU3PI2cTransmitBytes() will be called first. This gives the mutex to Transmitter. The mutex will be released only after the data transmission is complete or after a predefined timeout. If the device still has data to be transmitted when thread 1 times out, then Transmitter would still have the mutex. At that time you cannot receive data by using CyU3PI2cReceiveBytes() API. So the data will be either lost or it will have to wait until transmitter release its lock.
Best Regards,
Jayakrishna
Jayakrishna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
We do not recommend you to use the APIs from two different threads. Consider I2C example. If you have added CyU3PI2cTransmitBytes() API in thread 1 and CyU3PI2cReceiveBytes() API in thread 2, and if thread 1 starts first. Then CyU3PI2cTransmitBytes() will be called first. This gives the mutex to Transmitter. The mutex will be released only after the data transmission is complete or after a predefined timeout. If the device still has data to be transmitted when thread 1 times out, then Transmitter would still have the mutex. At that time you cannot receive data by using CyU3PI2cReceiveBytes() API. So the data will be either lost or it will have to wait until transmitter release its lock.
Best Regards,
Jayakrishna
Jayakrishna