Publication 1756-RM004B-EN-P - October 2000
Serial Port API 5-5
wordlen sets the word length in number of bits per character. Valid
values for word length are WORDLEN5, WORDLEN6, WORDLEN7,
and WORDLEN8.
The number of stop bits is set by stopbits. Valid values for stop bits are
STOPBITS1 and STOPBITS2.
The handshake lines DTR and RTS of the port specified by comport
are turned on by MVIsp_Open.
Note: If the console is enabled or the Setup jumper is installed, the
baud rate for COM1 is set as configured in BIOS Setup and cannot be
changed by MVIsp_Open. MVIsp_Open will return MVI_SUCCESS, but
the baud rate will not be affected. The console should be disabled in
BIOS Setup if COM1 is to be accessed with the serial API.
Return Value:
MVI_SUCCESS port was opened successfully
MVI_ERR_REOPEN port is already open
MVI_ERR_NODEVICE UART not found on port
Note: MVI_ERR_NODEVICE will be returned if the port is not
supported by the module.
Example:
if ( MVIsp_Open(COM1,BAUD_9600,PARITY_NONE,WORDLEN8,
STOPBITS1) != MVI_SUCCESS)
{ printf(“Open failed!\n”); }
else
{ printf(“Open succeeded\n”); }
See Also:
MVIsp_Close
MVIsp_OpenAlt
MVIsp_Open
IMPORTANT
Once the API has been opened, MVIsp_Close should
always be called before exiting the application.