BL4S200 User’s Manual
108
4.4.5 Serial Communication
Library files included with Dynamic C provide a full range of serial communications sup-
port. The
RS232.LIB
library provides a set of circular-buffer-based serial functions. The
PACKET.LIB
library provides packet-based serial functions where packets can be delim-
ited by the 9th bit, by transmission gaps, or with user-defined special characters. Both
libraries provide blocking functions, which do not return until they are finished transmit-
ting or receiving, and nonblocking functions, which must be called repeatedly until they
are finished. For more information, see the
Dynamic C User’s Manual
and Technical Note
213,
Rabbit Serial Port Software
.
Use the following function calls with the BL4S200.
serMode
int serMode(int mode);
FUNCTION DESCRIPTION
This function call sets the serial interfaces used by your application program. Call this
function after executing
serXopen()
and before using any other serial port function
calls.
PARAMETER
mode
the defined serial port configuration
The mode parameter has no effect on the BL4S210 model, which is configured in hard-
ware for RS-485 on Serial Port C and one 3-wire RS-232 channel on Serial Port B.
RETURN VALUE
0 if valid mode selected,
-EINVAL
if not.
SEE ALSO
ser485Tx, ser485Rx
Mode
BL4S200, BL5S220, and BL4S230 Models Only
Serial Port C
Serial Port E
Serial Port F
0
RS-485
RS-232, 3-wire
RS-232, 3-wire
1
RS-485
RS-232, 5-wire
RTS/CTS
electronic components distributor