ProSoft Technology MVI69-ADM User Manual

Page 237

Advertising
background image

MVI-ADM ♦ 'C' Programmable

Serial Port Library Functions

'C' Programmable Application Development Module

Developer's Guide

ProSoft Technology, Inc.

Page 237 of 342

February 20, 2013

MVIsp_OpenAlt

Syntax

int MVIsp_ OpenAlt(int comport, MVISPALTSETUP *altsetup);

Parameters

comport

Communications port to open

altsetup

pointer to structure of type MVISPALTSETUP

Description
MVIsp_OpenAlt provides an alternate method to acquire access to a
communications port.

With MVIsp_OpenAlt, the sizes of the serial port data queues can be set by the
application.

See MVIsp_Open for any considerations about opening a port.

Comport specifies which port is to be opened. See MVIsp_Open for valid values.

Altsetup points to a MVISPALTSETUP structure that contains the configuration
information for the port.

The MVISPALTSETUP structure is defined as follows:

typedef struct tagMVISPALTSETUP
{
BYTE baudrate;
BYTE parity;
BYTE wordlen;
BYTE stopbits;
int txquesize; /* Transmit queue size */
int rxquesize; /* Receive queue size */
BYTE fifosize; /* UART Internal FIFO size */
} MVISPALTSETUP;

See MVIsp_Open for valid values for the baudrate, parity, wordlen, and stopbits
members of the structure. The txquesize and rxquesize members determine the
size of the data buffers used to queue serial data. Valid values for the queue
sizes can be any value from MINQSIZE to MAXQSIZE. The MVIsp_Open
function uses a queue size of DEFQSIZE.

These values are defined as:

#define MINQSIZE 512 /* Minimum Queue Size */
#define DEFQSIZE 1024 /* Default Queue Size */
#define MAXQSIZE 16384 /* Maximum Queue Size */

By default, the API sets the UART’s internal receive fifo size to 8 characters to
permit greater reliability at higher baud rates. In certain serial protocols, this
buffering of characters can cause character timeouts and can be changed or
disabled to meet these requirements. Most applications should set the fifosize to
the default RXFIFO_DEFAULT.

Either MVIsp_OpenAlt or MVIsp_Open must be called before any of the other
API functions can be used.

Advertising