
SDK Programming Guide Version 1.511
ABLELink
R
Ethernet-Serial Server MAXI Series
6. API Reference
InitSerialMode()
Description:
Initialize the serial port communication mode.
Include:
DAPAPI.H
Usage:
ushort InitSerialMode (ushort
port
, uchar
mode
)
Input Parameters:
port:
Serial port number, 0: 1st port
mode:
Mode consists of four parts: baud rate, parity, data length and stop
bit length all in binary numbers. For detailed information, please
refer followings.
Bit Number
7 6 5 4
3
2
1 0
Setting
Baud rate
Parity
Stop bit Data length
000 – 19200 X0 - NONE
0 – 1
10 - 7 bits
001 – 38400 01 - ODD
1 – 2
11 – 8 bits
010 – 57600 11 - EVEN
011
–115200
100 - 1200
101 – 2400
110 - 4800
111 – 9600
Return Value:
Unsigned short
High byte contain: LSR (Line Status Register)
Bit 7 = Time out. 0: No timeout; 1: Send data timeout
Bit 6 = Transmission shift register empty
Bit 5 = Transmission holding register empty
Bit 4 = Break detect
Bit 3 = Framing error
Bit 2 = Parity error
Bit 1 = Overrun error
Bit 0 = Data ready
Low byte contain: MSR (Modem Status Register)
Bit 7 = Receive Line Signal Detect
Bit 6 = Ring Indicator
Bit 5 = Data Set Ready
Bit 4 = Clear to Send
Bit 3 = Delta Receive Line Signal Detect
Bit 2 = Trailing Edge Ring Indicator
Bit 1 = Delta Data Ready
Bit 0 = Delta Clear to Send
Copyright © 2004 Atop Technologies, Inc.
All rights reserved. Designed in Taiwan.