3 Replies Latest reply on May 31, 2012 2:45 AM by dhanraj.rajput

    I2C preamble question

    moon.young.joo

      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