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.

25<strong>SUB</strong>-<strong>20</strong><strong>SUB</strong>-<strong>20</strong> APIParameters· channel - Bit-bang I2C Master channel 0..3· sa - Slave Address· ma - Memory Address. Will be shifted out in "Memory Address Write" stage MSB first· ma_sz - Memory Address size bytes· buf - Buffer to store read data· sz - Read data size bytes.Return valueOn success function returns 0. Otherwise error code.See alsoError Codes, I2C StatusCompatibilityFW versionLibrary version0.2.6 or grater0.1.12.16 or grater3.4.4 sub_bb_i2c_writeSynopsisint sub_bb_i2c_write( sub_handle hndl, int channel, int sa, int ma, int ma_sz,char* buf, int sz )Perform complete I2C master write transaction with optional memory address write. Transaction will havefollowing format:If ma_sz is zero "Memory Address Write" stage will be skipped.Function has no limitation of the write data size - sz parameter. However internal organization of the I2C slavedevice being written should be considered especially Acknowledge Polling and EEPROM Page Write.Parameters· channel - Bit-bang I2C Master channel 0..3· sa - Slave Address· ma - Memory Address. Will be shifted out in "Memory Address Write" stage MSB first· ma_sz - Memory Address size bytes· buf - Buffer for data to be written· sz - Write data size bytesReturn valueOn success function returns 0. Otherwise error code.See also© <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!