beautypg.com

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

Page 29

background image

29

API Functions

aaInstallRxEvent

aaInstallRxEvent

Installs an application level event function to handle
receive data available events.

aaInstallRxEvent(EvFuncP)
void (*EvFuncP
)(int Dev);

Ptr to the event

function.

See the EvRxData() function for a description of the
event function.

void

The function installed here is called during an
interrupt service routine (

ISR)

. Keep your code short

and remember that many standard C library calls do
not work in

ISR

s, such as printf().

If using the Microsoft C compiler, stack checking must
be disabled during the event function and any functions
called by the event function.
Stack checking can be turned off and on with:

#pragma check_stack(off)

#pragma check_stack(on)

Function

Purpose

Call

Comments

Return

Warning

aaOpen

Open a device for reading or writing, or both.

aaOpen(Dev,OpenType,Baud,Parity,DataBits,StopBits,Flow

Ctl,
DetectEn,ModemCtl
)

int Dev

Device Number

unsigned int OpenType

COM_TX

for transmit or

COM_RX

for receive, or both.

unsigned char Baud

One of the

COM_BAUD_XX

flags

defined in

API.H

.

unsigned char Parity

One of:

COM_PAR_NONE

,

COM_PAR_EVEN

,

COM_PAR_ODD

.

unsigned char DataBits

One of

COM_DATABIT_7

,

COM_DATABIT_8

.

unsigned char StopBits

One of

COM_STOPBIT_1

,

COM_STOPBIT_2

.

unsigned int FlowCtl

Flow control flag, can be

COM_FLOW_NONE

or any

combination of

COM_FLOW_NONE

,

COM_FLOW_IS

,

COM_FLOW_OS

,

COM_FLOW_IH

,

COM_FLOW_OH

,

COM_FLOW_OXANY

.

unsigned int DetectEn

Detection enable flags, can be
any combination of the
following:

COM_DEN_NONE

No error
detection
enabled

COM_DEN_RDA

Enable Rx
data
available
detection

CON_DEN_MDM

Enable
modem
input
(

DSR

,

CD

,

or

CTS

)

change
detection

unsigned char ModemCtl

Modem control lines to turn

ON

, can be

COM_MDM_RTS

or

Function

Purpose

Call