.dircontrol Property

Function:

Sets/returns the polarity of the direction control line (RTS) for the selected serial port (selection is made through ser.num).

Type:

Enum (pl_ser_dircontrol, byte)

Value Range:

0 — PL_SER_DCP_LOWFORINPUT (default): The RTS output will be LOW when the serial port is ready to RX data and HIGH when the serial port is TXing data.

1 — PL_SER_SI_HIGHFORINPUT: The RTS output will be HIGH when the serial port is ready to rx data and LOW when the serial port is txing.

See Also:

UART Mode, Serial Settings


Details

This property is only relevant in the UART/half-duplex mode (ser.mode = 0 ؅— PL_SER_MODE_UART and ser.interface = 1 — PL_SER_SI_HALFDUPLEX).

Note that HIGH/LOW states specified above are for the TTL-serial interface of module-level products. If you are dealing with the RS232 port, then the states will be in reverse (for example, 1 — PL_SER_SI_HIGHFORINPUT will mean "RTS LOW for input, HIGH for output").

Depending on your platform, you may be allowed to remap RTS line to other I/O pins of the device through the ser.rtsmap and ser.ctsmap properties. Also, you may be required to configure RTS line as an input through the io.enabled property of the io. object. For more information, refer to your device's platform documentation (for example, the EM1000's is here).

When the serial port is in the UART/half-duplex mode, you can use the CTS line as a regular I/O line of your device.


.dircontrol Property

Details