Instruction manual
AMPDIO DRIVERS
Page 46
read and any additional parameters required to specify the source of the data to be read (see table
of data request types in section 3.4.3). These functions are currently only supported by the C/C++
and Delphi bindings supplied with the driver. For Visual Basic, the non-callback functions described
in section 3.4.3.3 may be used instead.
The TCsetUserInterrupt function is mainly for digital resources; the following types of data may be
requested:
ISR_NODATA
ISR_READ_16COUNT
ISR_READ_16COUNTSTAT
ISR_READ_32COUNT
ISR_READ_PPIABC
ISR_READ_PPIC
ISR_PC27
ISR_READ_DATA8
ISR_READ_DATA16
The TCsetUserInterruptAIO function is for analogue resources; the following types of data may be
requested:
ISR_READ_ADCS
ISR_READ_ADCSNOFIFO
ISR_READ_ADCSFIFO
ISR_READ_ADCSASAP
If the channel mask is set up to read more than one analogue channel, then the channels will be
read in a cyclic sequence starting with the lowest. For example, if the channel mask is set to 5
(101
2
), data will be read first from channel 0, then from channel 2, then cycling back to channel 0.
The functions also specify the callback function to be called and a user parameter which is passed
on to this callback function when it is called. The user must supply a callback function of the form:
typedef VOID (CALLBACK *TTCCALLBACK)( short h
, WPARAM wParam
, ULONG lParam
);
The wParam parameter is the user parameter specified in the TCsetUserInterrupt or
TCsetUserInterruptAIO function call. It can be any user value, a pointer to a user’s data structure, a
user code etc. The lParam contains the data the read by the driver. See section 6.4.13.4 for a
detailed description of the callback function.
3.4.3.2 Transferring Buffers Under Interrupt Control
The basic interrupt callback described in section 3.4.3.1 only allows data to be read from the card
on interrupt and only passes one value at a time to the user interrupt callback function. In addition,
each data value is passed from the kernel driver level to the user level in individual messages,
which causes a large system overhead at high data rates). To deal with these problems, the
buffered user interrupt functions described in this section may be used. ). These functions are
currently only supported by the C/C++ and Delphi bindings supplied with the driver. For Visual
Basic, the non-callback functions described in section 3.4.3.3 may be used instead.
The TCsetBufferUserInterrupt and TCsetBufferUserInterruptAIO functions (see sections 6.4.14.1
and 6.4.14.2) allow a user to be called back and to read or write large buffers of information to the
driver. The callback function is only called when a bufferful of data has been read or another
bufferful of data is required to be written. The functions allow the user to specify the interrupt