beautypg.com

Description of data typestrid, Description of api calls – Digilent Port Communications User Manual

Page 4

background image

Digilent, Inc

TM

DPCUTIL Programmer’s Manual

www.digilentinc.com

© Digilent, Inc.

Page

4 of 14


HWND

user specified window handle

MSG

WM_COMMAND

WPARAM
low order word
high order word


user specified identifier.
0

LPARAM

0

specification and Xilinx app notes on device
programming.

Using the DPCUTIL JTAG functions


Before using any JTAG functions,
DpcOpenJtag must be called to connect to a
communication device. The first parameter is
a HANDLE pointer. If the function returns
successfully, this handle will be used to
connect to the device in all proceeding JTAG
calls. The device is specified by name and
passed as the second parameter in the
DpcOpenJtag function.

DpcEnableJtag must be called directly after
DpcOpenJtag. This enables the driving of
JTAG signals on the communication device.

After these two API functions are called, any of
the JTAG functions can be used. When
finished, disable the JTAG interface and close

the device using DpcDisableJtag and
DpcCloseJtag
.

Multiple Instances of DPCUTIL (for
Win32 applications)

More than one application can use the
DPCUTIL.DLL at once. This presents the
possibility of the device table being changed
leaving other instances with outdated
information about it. To remedy this, an
application should register itself with the
DpcStartNotify function. Whenever a
modification is made to the device table, a
registered application will be notified of the
change via a message sent to the provided
window handle. The application can then
reload all needed information about the device
table. The following is a description of the
message parameters to the window procedure:


To stop notification messages, an application
should call the DpcEndNotify function.

Description of Data
TypesTRID

16 bit data type that holds the ID of a
transaction (used for non-blocking calls)

ERC
32 bit (signed) data type. Holds error code for
a finished transaction

TRT
32 bit (signed) data type. Holds code for
transaction type

STS
32 bit (signed) data type. Holds code for
transaction status

DVCT
32 bit (signed) data type. Holds code for
communications interface type.
TRS
Structure that contains the following
information about a transaction:

Typedef struct tagTRS {
TRT

trt;

/* transaction type */

TRID trid;

/* transaction ID */

STS

sts;

/* status of transaction */

ERC erc;

/* error code for transaction */

}TRS;

Description of API calls


API Startup/Cleanup calls


BOOL DpcInit(ERC * perc)

Parameters
perc

-

pointer to store

error code

Return Values
Returns true if DLL instance is properly
initialized