Adm api files – ProSoft Technology MVI69-ADM User Manual

Page 60

Advertising
background image

Understanding the MVI-ADM API

MVI-ADM ♦ 'C' Programmable

Developer's Guide

'C' Programmable Application Development Module

Page 60 of 342

ProSoft Technology, Inc.

February 20, 2013

3.6

ADM API Files

The following table lists the supplied API file names. These files should be copied
to a convenient directory on the computer where the application is to be
developed. These files need not be present on the module when executing the
application.

ADM API File Names

File Name

Description

admapi.h

Include file

admapi.lib

Library (16-bit OMF format)

3.6.1 ADM Interface Structure

The ADM interface structure functions as a data exchange between the ADM API
and user developed code. Pointers to structures are used so the API can access
structures created and named by the developer. This allows the developer
flexibility in function naming. The ADM API requires the interface structure and
the structures referenced by it. The interface structure also contains pointers to
functions. These functions allow the developer to insert code into some of the
ADM functions. The functions are required, but they can be empty. Refer to the
example code section for examples of the functions. It is the developer's
responsibility to declare and initialize these structures.

The interface structure is as follows:

typedef struct
{
ADM_BT_DATA *adm_bt_data_ptr; /* pointer to struct holding
ADM_BT_DATA */
ADM_BLK_ERRORS *adm_bt_err_ptr; /* pointer to struct holding
ADM_BT_DATA */
ADM_PORT *adm_port_ptr[4]; /* pointer to struct holding
ADM_PORT */
ADM_MODULE *adm_module_ptr; /* pointer to struct holding
ADM_MODULE */
ADM_PORT_ERRORS *adm_port_errors_ptr[4]; /* pointer to struct
holding ADM_PORT_ERRORS */
ADM_PRODUCT *adm_product_ptr; /* pointer to struct holding
ADM_PRODUCT */
int (*startup_ptr)(void); /* pointer to function for
startup code */
int (*shutdown_ptr)(void); /* pointer to function for
shutdown code */
int (*user_menu_ptr)(void); /* pointer to function for
additional menu code */
void (*version_ptr)(void); /* pointer to function for
version information */
void (*process_cfg_ptr)(void); /* pointer to function for
checking configuration */
int (*ctrl_data_block_ptr)(unsigned short); /* pointer to
function for checking configuration */
unsigned short pass_cnt;
short debug_mode;

Advertising