Solvline PB2xxxUG User Manual

Page 80

Advertising
background image

U_open_port_2010

2010 Serial Port Open

Description This function opens the serial port whose port number is 1.

(Related Device : only 2010)

Synopsis

int U_open_port_2010

Parameters

Returns

1 ~ n

: File descriptor if successful.

-1 :

Otherwise

U_init_port

Initialize Serial Port

Description This function sets the parameters associated with the terminal referred to by

the open file descriptor fd (an open file descriptor associated with a serial)
from speed, lcr, and flow.

Synopsis

void U_init_port (int fd, int speed, char lcr, char flow)

Parameters fd

: Serial file descriptor

speed

: Setting Bauds

0 = 150

6 = 9600

1 = 300

7 = 19200

2 = 600

8 = 38400

3 = 1200

9 = 57600

4 = 2400

10 = 115200

5 = 4800

11 = 230400

Lcr

: Setting Standard LSR Register

XXXXXXXX

Data Bits : 0x00 = 5, 0x01 = 6, 0x02 = 7, 0x03 = 8

Stop Bits : 0x00 = 1, 0x04 = 2

Parity Bits : 0x00 = None, 0x08 = Odd, 0x18 = Even

flow

: Setting Flow Control

0 = None, 1 = Xon/Xoff, 2 = RTS/CTS

80

Advertising