Where can i find the EZI2C slave sub-address get

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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.

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

0 Likes
Anonymous
Not applicable

Hi Bob:

   

  thank you for your reply.

   

So the READ_ONLY_OFFSET is the sub-address length, is it right?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

0 Likes
Anonymous
Not applicable

Thank you Bob.

   

I am OK now.

0 Likes