- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I'm trying to debug my project and I would just like to know if there is anyway I can detect the interrupt service that creates a response on the I2C_slave component when a master sends a read/write. According to the API in the datasheet I can't seem to find any function that would give me that kind of information.
Thank you!
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The slave can be observed using I2CSlaveStatus(void) API. Bits need to be cleared using I2CSlaveClearReadStatus(void). See datasheet.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The slave will acknoledge every master action. This is reflected in the status byte returned by all the basic I2C APIs.
Use sendStart(), Write(), SendRestart(),ReadByte() and SendStop(). Check all returned status for zero meaning success.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Bob
Those are I2C_master functions though and I'm trying to do that with I2C_slave functions. Is it possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The slave can be observed using I2CSlaveStatus(void) API. Bits need to be cleared using I2CSlaveClearReadStatus(void). See datasheet.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Other than that, which I can see from the datasheet, is there anything I can get from the slave to tell me how many bytes have been requested by the master or when were those bytes requested? Or do I have to rely on just 3 slave status constants to try and debug my program?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I2CSlaveGetReadBufSize(void) API returns the number of bytes read by the master from read buffer. See datasheet
Bob