I2C preamble question

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

cross mob
Anonymous
Not applicable

If i want to send byte address rather than word address ,  Does  the following change of the sample code work well, If I change the sdk code as followings?

   

Sample Code in SDK,

   

           preamble.length    = 4;
            preamble.buffer[0] = devAddr;
            preamble.buffer[1] = (uint8_t)(byteAddress >> 8);
            preamble.buffer[2] = (uint8_t)(byteAddress & 0xFF);
            preamble.buffer[3] = (devAddr | 0x01);
            preamble.ctrlMask  = 0x0004;
 

   

To

   

         preamble.length    = 3;
            preamble.buffer[0] = devAddr;
            preamble.buffer[1] = regAddress;  //My new 8 bit address
            preamble.buffer[2] = (devAddr | 0x01);
            preamble.ctrlMask  = 0x0004;
 

   

Thanks for help

0 Likes
3 Replies
Anonymous
Not applicable

attached document has details on it. let me know if it does not helps.

0 Likes
Anonymous
Not applicable

attaching again

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
0 Likes