Digilent Port Communications User Manual
Page 2

Digilent, Inc
TM
DPCUTIL Programmer’s Manual
www.digilentinc.com
© Digilent, Inc.
Page
2 of 14
directory where the program executable
resides or in any directory listed on the system
PATH environment variable.
DPCUTIL API functions
Most DPCUTIL API calls are formed into
transactions. These transactions are put into a
queue and processed on a first-in-first-out
basis (FIFO). A function can either return upon
completion (blocking) or return immediately
and be processed on another thread (non-
blocking). A transaction entered into the
queue is assigned a TRID (Transaction ID), a
value used to distinguish between
transactions.
DPCUTIL API functions that require an
established connection with a communications
device must be passed a HIF (interface
handle) to specify the connection to use. This
handle is acquired by calling DpcOpenJtag or
DpcOpenData.
Most DPCUTIL API functions require a pointer
to an error code of type ERC. This variable will
hold the error code for a completed
transaction.
Most JTAG and Data Transfer functions have a
pointer of type TRID as a parameter. If this
parameter is set to NULL, the function will
block and not return until the transaction has
completed. Otherwise, if a non-null TRID
pointer is sent, the function will return
immediately and the transaction will be
processed on a different thread. Since none of
the data sent to DPCUTIL is copied, all data
sent to a non-blocking API call must remain
intact and unchanged until the transaction is
complete. Calling the DpcWaitForTransaction
function and sending it the TRID of a particular
transaction will allow an application to wait for
the completion of the transaction. Sending a
TRID of NULL to DpcWaitForTransaction will
force a wait on all transactions in the queue.
Initializing DPCUTIL
Before any of the DPCUTIL API functions can
be used, the DpcInit function must be called. If
it returns false, an error occurred while
attaching and initializing the DLL. The
application must not call any other DPCUTIL
API functions if DpcInit returns false.
The following is a simple list of all DPCUTIL API functions (with return types) available for public use:
BOOL DpcInit
BOOL DpcPutTmsTdiBits
VOID DpcTerm
BOOL DpcGetTdoBits
BOOL DpcGetDpcVersion
BOOL DpcOpenData
BOOL DpcStartNotify
BOOL DpcCloseData
BOOL DpcEndNotify
BOOL DpcPutReg
BOOL DpcQueryConfigStatus
BOOL DpcGetReg
BOOL DpcPendingTransactions
BOOL DpcPutRegSet
BOOL DpcAbortConfigTransaction
BOOL DpcGetRegSet
BOOL DpcClearConfigStatus
BOOL DpcPutRegRepeat
BOOL DpcWaitForTransaction
BOOL DpcGetRegRepeat
ERC DpcGetFirstError
VOID DvmgStartConfigureDevices
BOOL DpcOpenJtag
int
DvmgGetDevCount
BOOL DpcCloseJtag
BOOL DvmgGetDevName
BOOL DpcEnableJtag
BOOL DvmgGetDevType
BOOL DpcDisableJtag
int
DvmgGetDefaultDev
BOOL DpcSetTmsTdiTck
int DvmgGetHDVC
BOOL DpcPutTdiBits