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.

16<strong>SUB</strong>-<strong>20</strong><strong>SUB</strong>-<strong>20</strong> APIGet version of shared (DLL) or static library, driver, <strong>SUB</strong>-<strong>20</strong> device and bootloader.Return valueFunction fills internal structure with gathered versions and returns pointer to this structure.Exampleconst struct sub_version* sub_ver;sub_ver = sub_get_version( hndl );3.1.6 sub_resetSynopsisint sub_reset( sub_handle hndl );Reset <strong>SUB</strong>-<strong>20</strong> device.Return valueOn success function returns 0. Otherwise error code.3.2 Internal EEPROM FunctionsBeginning from the firmware version 0.3.4 and library version 0.1.12.26, <strong>SUB</strong>-<strong>20</strong> provides access to it's internalEEPROM (non volatile memory). EEPROM memory array size is 1KB, endurance: 100,000 Write/Erase Cycles.EEPROM Memory array can be freely used by application without any format or interdependency restrictions.Access to EEPROM is gained by two simple functions:sub_eep_readsub_eep_write3.2.1 sub_eep_readSynopsisint sub_eep_read( sub_handle hndl, int addr, char* buf, int sz )Read sz bytes from internal EEPROM starting from address addr. Read data will be stored in buf.Parameters· addr - read start address· buf - buffer to store read data· sz - read size, max 64 bytes.Return valueOn success function returns 0. Otherwise error code.3.2.2 sub_eep_writeSynopsisint sub_eep_write( sub_handle hndl, int addr, char* buf, int sz )Write sz bytes into internal EEPROM starting from address addr. Write data is taken from buf.© <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!