beautypg.com

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

Page 35

background image

35

API Functions

EvPeriodic

EvPeriodic

Application periodic event function

EvPeriodic()

void

This function is not part of the

API

, it must be written

by the developer as part of the application program.
The function name EvPeriodic is an example name only,
this event function can be given any name desired.
This function is not called directly by the application.
Instead it is dispatched by the

API

’s internal

ISR

(interrupt service routine) when it detects that receive
data is available. Before this function will be
dispatched it must be installed with
aaInstallPeriodicEvent(), and periodic events must be
enabled with aaEnPeriodicEvent().
Once installed and enabled, the periodic event function
is called 274 times a second regardless of the state of
controller.
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

Return

Warning

Warning

EvRxData

Application receive data available event function

EvRxData(Dev)
int Dev
:

Device number

void

This function is not part of the

API

, it must be written

by the developer as part of the application program.
The function name EvRxData is an example name only,
this event function can be given any name desired.
This function is not called directly by the application.
Instead, it is dispatched by the

API

’s internal

ISR

(interrupt service routine) when it detects that receive
data is available. Before this function will be
dispatched it must be installed with aaInstallRxEvent(),
and receive data available detection must be enabled.
Detection is enabled using the DetectEn parameter of
aaOpen() or aaReconfigure().
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

Return

Warning

Warning