beautypg.com

Comtrol API (6508) for the MS-DOS User Manual

Page 9

background image

9

Developing Applications

This section describes the following topics:

API

features and functions

Writing the configuration file

Using the

API

(flowchart and example)

Include files

Configuring the controllers

Using

API

calls to write the application

-

Understanding device numbers

-

Configuration parameters for serial devices

Writing serial data

Exiting the application

Reading serial data

Installing and detecting events

Building applications

2.1.

API

Features

The

API

contains the following features:

Supports up to 4 RocketPort controllers in a

PC.

Supports up to 32 serial devices per controller.

Provides baud rates from 50 to 230.4 K baud.

Supports all modem control lines available on the controller.

Provides detection of modem control line changes.

Provides direct control of modem control outputs.

Provides direct read of modem control inputs.

Provides detection of receive errors:
-

Parity

-

Receiver overrun

-

Framing

-

Buffer overflow

Supports

1K

bytes of receive data buffering and

256

bytes of transmit data

buffering.

Supports hardware (

RTS/CTS

) flow control.

Supports software (

XON/XOFF

) flow control.

Provides read counts of buffered transmit and receive data.

Provides send break and receive break detection.

Provides installable event functions for the following:
-

Receive data available

-

Modem control changes

-

Periodic event

For information about event functions see Subsection 2.12.

2.2.

API

Functions

Table 2-1 lists

API

functions that are available to a system application. For

detailed information about the functions, see Appendix A.

Table 2-1.

API

Functions

Function Name

Description

aaChangeModemState

Changes the state of modem
output lines.

aaClose

Closes a device.

aaEnPeriodicEvent

Enables/disables dispatching of
periodic event function.

aaExit

Performs cleanup when exiting
application.

aaFlush

Flushes transmit or receive
buffer, or both.

aaGetCtlStatus

Gets controller status.

aaGetModemStatus

Gets modem status.

aaGetRxCount

Gets count of data bytes available
in receive buffer.

aaGetRxStatus

Gets status of receive buffer.

aaGetTxCount

Gets count of data bytes in
transmit buffer.

aaInit

Executes controller and

API

initialization.

aaInstallCtrlCHandler

Installs a handler for the

CTRL+C

key interrupt.

Section 2. Developing Applications