Sensoray 2600 User Manual
Page 69

Sensoray 2600 Programming Guide
65
Comport Transaction Functions
Prototype:
u32 S26_ComSetMode(u32 hbd,u8 dev,u16 cdiv,u8 mode,u8 leds,u32 msec,u32 retries);
Parameter
Type
Description
hbd
u32
MM handle.
dev
u8
Logical device identifier for the target comport. Specify a value from 1 to 4 to
address comport 1 to 4, respectively.
cdiv
u16
Clock divisor for the baud rate generator. May be set to any value between
SIO_BR_300
and SIO_BR_115200.
mode
u8
Collection of enumerated values that set various operating attributes. The byte value
is formed by logically or’ing one value from each of the following groups:
Parity: SIO_PARITY_ODD, SIO_PARITY_EVEN, or SIO_PARITY_NONE.
Databits: from SIO_DATABITS_5 to SIO_DATABITS_8.
Stopbits: SIO_STOPBITS_1 or SIO_STOPBITS_2.
Flow control: SIO_FLOWCTRL_OFF or SIO_FLOWCTRL_ON.
Interface type: SIO_PHY_RS232, SIO_PHY_RS422_IDLEON,
SIO_PHY_RS485
or SIO_PHY_RS422_IDLEOFF.
leds
u8
Specifies the events that will cause the comport status LED to light. May be any
combination of the following: SIO_LED_TRANSMIT, SIO_LED_RECEIVE,
SIO_LED_ERROR
. The byte value is formed by logically or’ing the desired events.
msec
u32
Maximum time, in milliseconds, to wait for the MM to respond.
retries
u32
Maximum number of transaction retry attempts.
cdiv
may be set to any of the following values in order to
program standard baud rates. Bold type indicates the default
setting after a module reset. Setting cdiv to any value not
shown in the table will result in a non-standard baud rate.
The mode byte is shown below. Bold type indicates the
default settings after a module reset.
Baud Rate
cdiv[0]
300
0x0300
600
0x0180
1200
0x00C0
2400
0x0060
4800
0x0030
9600
0x0018
19.2K
0x000C
38.4K
0x0006
57.6K
0x0004
115.2K
0x0002
FLOW
PAR0 STOP
DAT1
DAT0
PAR1
00 = 5 bits
Char Size
01 = 6 bits
10 = 7 bits
11 = 8 bits
X0 = None
Parity
01 = Odd
11 = Even
0 = 1 bit
Stop Bit Length (in bit times)
1 = 1.5 bits (char size 5)
1 = 2 bits (char sizes 6,7,8)
Enable XON/XOFF
00 = RS232
Physical Layer
01 = RS422, Tx always on
Flow Control
PHY1
PHY0
10 = RS4xx, half-duplex
11 = RS4xx, idle 3-state