Using the QuickUSB Library
QuickUsbReadDataAsync
Purpose
Read a block of data values from the high-speed parallel port using an
asynchronous function call.
Parameters
hDevice: A HANDLE that was returned from a call to QuickUsbOpen.
data:
A pointer to a buffer in which to place data read from the HSPP.
See notes.
length: A ULONG containing the number of bytes to read from the
HSPP.
See notes
.
transaction:
A PBYTE to a BYTE in which to place the transaction
identifier required by QuickUsbAsyncWait.
Returns
A LONG that is non-zero on success, zero (0) on failure.
Notes
•
QuickUSB asynchronous function calls return immediately and must
be followed by a call to QuickUsbAsyncWait to determine when the
transaction actually completes and to free internal buffers used by
the operating system. Failure to follow this procedure will result in a
memory leak and an eventual system crash.
•
The maximum length is 16 megabytes (16777216 bytes.
•
The data buffer can receive data values of any type.
•
In master mode, data values are transferred over the high-speed
parallel port with the CMD_DATA line set to ‘0’.
•
In slave mode, the USB will hang and wait for ‘length’ transfers to
occur before returning. If the target interface does not read length
transfers from the slave FIFOs, the call will return with a value of 0
and set the last error status to QUICKUSB_ERROR_TIMEOUT after the
timeout value specified by the QuickUsbSetTimeout function.
•
The address bus behavior for data transfers is defined by the
•
There is a global maximum of 253 asynchronous reads and writes
outstanding at any time for all QuickUSB modules in the system.
•
This function is not yet supported for Linux-based systems.
High-Speed Parallel Port
59