title: Why there is a word address in this I2C example code from FTDI?
body: <p>I have been working on FTDI FT2232H chip to interface with I2C devices. I have started to learn <a href="https://www.ftdichip.com/Support/Documents/AppNotes/AN_177_User_Guide_For_LibMPSSE-I2C.pdf" rel="nofollow noreferrer">AN_177</a> application note pdf. I have no EEPROM to expreience,no oscilloscope to see waveforms. My goal is to comprehend the code itself and taking notes for my future projects. Here is the code snippet that i dont completely understand:</p>
  
  <pre><code>FT_STATUS write_byte(uint8 slaveAddress, uint8 registerAddress, uint8 data)
  {
      uint32 bytesToTransfer = 0;
      uint32 bytesTransfered;
      bool writeComplete=0;
      uint32 retry=0;
      bytesToTransfer=0;
      bytesTransfered=0;
      buffer[bytesToTransfer++]=registerAddress; /* Byte addressed inside EEPROM */
      buffer[bytesToTransfer++]=data;
      status = I2C_DeviceWrite(ftHandle, slaveAddress, bytesToTransfer, buffer, &amp;bytesTransfered, I2C_TRANSFER_OPTIONS_START_BIT|I2C_TRANSFER_OPTIONS_STOP_BIT);
  
      /* poll to check completition */
      while((writeComplete==0)&amp;&amp; (retry&lt;I2C_WRITE_COMPLETION_RETRY))
      {
          bytesToTransfer=0;
          bytesTransfered=0;
          buffer[bytesToTransfer++]=registerAddress; /* Addressed inside EEPROM  */
          status = I2C_DeviceWrite(ftHandle, slaveAddress, bytesToTransfer,buffer, &amp;bytesTransfered, I2C_TRANSFER_OPTIONS_START_BIT|I2C_TRANSFER_OPTIONS_BREAK_ON_NACK);
  
          if((FT_OK == status) &amp;&amp; (bytesToTransfer == bytesTransfered))
          {
              writeComplete=1;
              printf("  ... Write done\n");
          }
          retry++;
      }
      return status;
  }
  </code></pre>
  
  <p>You can see and understand that the while loop is the polling part.</p>
  
  <p>I checked the datasheet of <a href="http://ww1.microchip.com/downloads/en/devicedoc/22102a.pdf" rel="nofollow noreferrer">24LC024H</a> I2C EEPROM and they mentioned about Acknowladge Polling (Page 10) is a feature of this kind of EEPROMs'. Acknowladge Polling basicly checks when the device is ready to send data. There is a flow diagram too... you could take a look.
  <a href="https://i.stack.imgur.com/mJbRl.png" rel="nofollow noreferrer">Flowchart</a></p>
  
  <p>Here comes the what i want to point out:</p>
  
  <pre><code>buffer[bytesToTransfer++]=registerAddress; /* Addressed inside EEPROM  */
  </code></pre>
  
  <p>In the 24LC024H datasheet related to Acknowladge Polling they say polling part consist of START + Control Byte (or Slave address) + R/W bit, not include address inside EEPROM (Word address in I2C protocol) . So why FTDI guys included this line of code? Am I missing something?</p>
  
  <p>Best regards...</p>