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.

19<strong>SUB</strong>-<strong>20</strong><strong>SUB</strong>-<strong>20</strong> API3.3.3 sub_i2c_startSynopsisint sub_i2c_start( sub_handle hndl )Generate I2C start condition.Return valueOn success function returns 0. Otherwise error code.See alsoError Codes, I2C Status3.3.4 sub_i2c_stopSynopsisint sub_i2c_stop( sub_handle hndl )Generate I2C stop condition.Return valueOn success function returns 0. Otherwise error code.See alsoError Codes, I2C Status3.3.5 sub_i2c_scanSynopsisint sub_i2c_scan( sub_handle hndl, int* slave_cnt, char* slave_buf )Scan I2C bus looking for connected slave devices.Parameters· *slave_cnt - Buffer to store number of found slave devices· slave_buf - Buffer to store found slave device addressesReturn valueOn success function returns 0. Otherwise error code.See alsoError Codes, I2C Status3.3.6 sub_i2c_readSynopsisint sub_i2c_read( sub_handle hndl, int sa, int ma, int ma_sz,char* buf, int sz )Perform complete I2C master read transaction with optional memory address write. Transaction will have© <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!