Using the QuickUSB Library
QuickUsbWriteData
Purpose
Write a block of data values to the high-speed parallel port using the
QuickUSB module.
Parameters
hDevice: A HANDLE that was returned from a call to QuickUsbOpen.
data:
A pointer to a block of data values to write to the HSPP.
See
notes.
length:
A ULONG containing the number of bytes to write to the HSPP.
See notes
.
Returns
A LONG that is non-zero on success, zero (0) on failure.
Notes
•
The maximum length is 16 megabytes (16777216 bytes).
•
The data buffer can contain 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
58
High-Speed Parallel Port