sub_rs_timing

Top  Previous  Next
Got to SUB-20 page

Synopsis

int 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 by sub_rx_xfer function.

Parameters

flags - one or none of the below flags:

 

RS_RX_BEFORE_TX

Receive message and after that transmit message

RS_RX_AFTER_TX

Transmit message and after that receive message

none

Receive 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 µs

 

Delay 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  parameters

rx_msg_us=0

rx_byte_us=0

Message reception will last no more then 4s

rx_msg_us=0

rx_byte_us>0

First byte reception will last no more then 4s. Every next byte should be received in rx_byte_us time

rx_msg_us>0

rx_byte_us=0

Message reception will last no more then rx_msg_us time

rx_msg_us>0

rx_byte_us>0

First byte reception will last no more then rx_msg_us time. Every next byte should be received in rx_byte_us time

 

Return value

On success function returns 0. Otherwise error code.

Example

/* Request message transmit and after that receipt */

/* No space between transmitted bytes */

/* Message should be received in 1s */

sub_rs_timing( hndl, RS_RX_AFTER_TX, 0, 1000000, 0 );