Using the QuickUSB Library
RS-232
The RS-232 ports are interrupt-driven for transmit and receive. The QuickUSB
RS232 receive buffers are 128 bytes deep, so your software just needs to
service these buffers often enough to make sure they do not overflow.
QuickUsbSetRs232BaudRate
Purpose
Set the baud rate for both serial ports. Baud rates are programmable from
4800 to 230k baud. This function sets the baud rate of both serial ports.
It is not possible to set the baud rate of each serial port independently.
Parameters
hDevice: A HANDLE that was returned from a call to QuickUsbOpen.
baudRate: An unsigned long integer (32-bits) containing the baud rate in
bits per second.
Returns
A non-zero value if successful, 0 otherwise.
Notes
None
QuickUsbGetNumRS232
Purpose
Read the number of characters waiting in the receive buffer.
Parameters
hDevice: A HANDLE that was returned from a call to QuickUsbOpen.
portNum: The serial port number. Serial port 0 (P1) = 0, serial port 1 (P2)
= 1.
length: A pointer to the number of characters to read. Set to the
number of characters actually read on return.
Returns
A non-zero value and the number of outstanding characters if successful, 0
otherwise.
Notes
None.
64
RS-232