User`s manual

Table Of Contents
W406-LX Linux User’s Manual Programmer’s Guide
6-17
Sets the UART interface.
BOOL uart_setmode(int port, int mode);
Inputs:
<port> the serial port number.
<mode> the interface parameter.
0 : RS-232
1 : RS485-2W
2 : RS422
3 : RS485-4W
Return Values:
TRUE indicates success, FALSE indicates failed.
Remark:
For example, user uart_getmode(2) to retrieve the interface of COM2:
DIO
Opens a DIO handle for later use.
HANDLE mxdio_init(void);
Inputs:
none
Return Values:
pointer to a DIO handle. Return 0 on failure.
Remark:
Every DIO API needs the handle parameter, so you must use the function first before you program
them.
Closes the DIO handle.
void mxdio_stop(HANDLE hDIO);
Inputs:
<hDIO> the DIO handle
Return Values:
None
Remark:
Sets one of the DOUT outputs.
int mxdio_set_dout(HANDLE hDIO, unsigned int port, unsigned int data);
Inputs:
<hDIO> the DIO handle
<port> the port index, from 0 to 3 mapping to DO0~DO3
<data> 1: HIGH, 0: LOW
Return Values:
0 on success, otherwise, the function fails
Remark: