12.07.2015 Views

SUB-20 User Manual - Dimax

SUB-20 User Manual - Dimax

SUB-20 User Manual - Dimax

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

17<strong>SUB</strong>-<strong>20</strong><strong>SUB</strong>-<strong>20</strong> APIParameters· addr - write start address· buf - buffer for data to be written· sz - write size, max 64 bytes.Return valueOn success function returns 0. Otherwise error code.3.3 I2C functionsSlave Address ConventionSlave address parameter referenced in I2C related functions is 7 bit number representing I2C slave deviceaddress without R/W bit. For example with slave address parameter equal 0x50 slave address stage of the I2Ctransaction will look like:Acknowledge PollingI2C EEPROM slave devices may enter internal memory write cycle. Once the internally-timed write cycle hasstarted EEPROM inputs are disabled, acknowledge polling can be initiated. This involves sending a startcondition followed by the device slave address and R/W bit. Only if the internal write cycle has completed will theEEPROM respond with an ACK, allowing the read or write sequence to continue. Acknowledge polling should beperformed on application level. <strong>SUB</strong>-<strong>20</strong> knows nothing about nature of I2C slave device it is connected to.EEPROM Page WriteI2C EEPROMs are usually capable of no more then 64-byte page writes. The internal EEPROM data addresslower 6 bits are internally incremented following the receipt of each data byte. The higher data address bits arenot incremented, retaining the memory page row location. When the data address, internally generated, reachesthe page boundary, the following byte is placed at the beginning of the same page. If more than 64 data bytesare transmitted to the EEPROM, the data address will “roll over” and previous data will be overwritten. Theaddress “roll over” during write is from the last byte of the current page to the first byte of the same page.High Speed SupportBeginning from FW version 0.3.2 and library version 0.1.12.24, <strong>SUB</strong>-<strong>20</strong> provides High Speed (HS) I2C Mastercapabilities compliant to "I2C Bus Specification Rev 3.0". HS I2C Master functionality is available viasub_i2c_hs_rw API call. Timing characteristics can be found here HS I2C Master AC CharacteristicsSlave Mode<strong>SUB</strong>-<strong>20</strong> can work in both I2C master and I2C slave modes. Detailed description of I2C slave mode can be foundhere: <strong>SUB</strong>-<strong>20</strong> as I2C Slave.Functions© <strong>20</strong>13 xdimax.com rev 2.17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!