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.

49<strong>SUB</strong>-<strong>20</strong><strong>SUB</strong>-<strong>20</strong> API· baud - Desired baudrate. Maximum baudrate is 2Mbps. The actual baudrate may slightly differ from thedesired as actual baudrate is an integer quotient from dividing the 16MHz reference clock.Return valueOn success function returns 0. Otherwise error code.Example/* Set 9660 bps, 8 data bits, no parity, 1 stop bit */sub_rs_set_config( hndl,RS_RX_ENABLE|RS_TX_ENABLE|RS_CHAR_8|RS_PARITY_NONE|RS_STOP_1, 9600 );3.10.2 sub_rs_get_configSynopsisint sub_rs_get_config( sub_handle hndl, int* config, int* baud)Read current <strong>SUB</strong>-<strong>20</strong> UART configuration.Parameters· *config - will be filled with UART configuration see sub_rs_set_config for details· *baud - will be filled with actual UART baudrateReturn valueOn success function returns 0. Otherwise error code.3.10.3 sub_rs_timingSynopsisint sub_rs_timing( sub_handle hndl, int flags, int tx_space_us,int rx_msg_us, int rx_byte_us )Configure UART transfer timing and order of transmit and receive operations. Actual transfer is initiated bysub_rx_xfer function.Parameters· flags - one or none of the below flags:RS_RX_BEFORE_TXRS_RX_AFTER_TXnoneReceive message and after that transmit messageTransmit message and after that receive messageReceive and transmit simultaneously· tx_space_us - delay in µs between subsequent byte transmit· rx_msg_us - message reception timeout in µs· rx_byte_us - byte to byte reception timeout in µsDelay and timeouts precision is ± 64 µs. They should not exceed 4.000.000µs = 4s.Following table explains relation between rx_msg_us and rx_byte_us parametersrx_msg_us=0 rx_byte_us=0 Message reception will last no more then 4srx_msg_us=0 rx_byte_us>0 First byte reception will last no more then 4s. Every next byte shouldbe received in rx_byte_us timerx_msg_us>0 rx_byte_us=0 Message reception will last no more then rx_msg_us time© <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!