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.

21<strong>SUB</strong>-<strong>20</strong><strong>SUB</strong>-<strong>20</strong> API· 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 alsoError Codes, I2C Status3.3.8 sub_i2c_hs_rwSynopsisint sub_i2c_hs_rw( sub_handle hndl, int mcode, int count,struct sub_i2c_hs_xfer* px );Perform High Speed (HS) I2C Master read/write transaction(s) with prior master code transmit according toI2C-bus specification. The whole session has the following format:At the beginning of the session both master and slave are in Fast Speed or Standard I2C mode. Master issuesSTART condition and transmits Master Code 00001xxx, where xxx is under SW control via mcode parameter.(Master Code 00001000 should not be used as it is reserved by I2C-bus specification for future extensions).Master Code will not be acknowledged - NAK will be generated. At the end of NAK I2C-bus is in HS mode. Nowmaster can perform HS read/write transactions by issuing REPEATED START condition followed by SlaveAddress with R/W bit and data byte(s) being read/written according to R/W bit. To exit HS mode master issuesSTOP condition. A number of HS transactions can be performed within single HS mode session (it isrecommended by I2C-bus specification).Parameters· mcode - Master Code lower 3 bits· count - number of HS mode read/write transactions to perform· px - pointer to array of count transaction descriptors of type struct sub_i2c_hs_xferstruct sub_i2c_hs_xfer{int sa;int r_w;int sz;int act_sz;char data[64];int status;© <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!