- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I want to use the PSoC4 EZI2C Slave block.
I also study the example "SCB_EzI2cCommSlave", but I can't find where i can get the sub-address from master.
In this demo project, it is said that the read base address is 0x03, but I can't find where it is set?
For example:
The master want to read data from sub-address"0x01"-"0x05", how can I set the slave?
Best regards
thanks a lot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum, Mickey!
The sub-address is an index into the read buffer in this example and determines from which address the master starts reading from the slave. in this case in the slave project the position is set with
EZI2C_EzI2CSetBuffer1(BUFFER_SIZE, READ_ONLY_OFFSET, ezI2cBuffer);
where the READ_ONLY_OFFSET is #defined as 3 (0x03)
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob:
thank you for your reply.
So the READ_ONLY_OFFSET is the sub-address length, is it right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So the READ_ONLY_OFFSET is the sub-address length, is it right?
Not quite: It is not a length. The sub-address lemgth indicates whether you may use values between 0..255 or between 0..65535. sub-address is used as an index into the buffer to distinguish the write area from the read-only area, see datasheet.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Bob.
I am OK now.