Difference between revisions of "Unit PL2303"

From Ultibo.org
Jump to: navigation, search
 
(19 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
----
 
----
 +
 +
'''Prolific PL2303 USB to Serial Driver unit'''
  
 
The Prolific PL2303 is a USB to serial interface chip used by multiple vendors.
 
The Prolific PL2303 is a USB to serial interface chip used by multiple vendors.
Line 12: Line 14:
 
----
 
----
  
''To be documented''
+
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''PL2303 specific constants''' <code> PL2303_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL2303_DRIVER_NAME = 'Prolific PL2303 USB to Serial Driver';</code>
 +
| Name of PL2303 driver
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_SERIAL_DESCRIPTION = 'Prolific PL2303 USB to Serial';</code>
 +
| Description of PL2303 device
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_MIN_BAUD = 75;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_MAX_BAUD = 1228800;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_MAX_BAUD_HX = 12000000;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_MIN_DATABITS = SERIAL_DATA_5BIT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_MAX_DATABITS = SERIAL_DATA_8BIT;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_MIN_STOPBITS = SERIAL_STOP_1BIT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_MAX_STOPBITS = SERIAL_STOP_1BIT5;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_MAX_PARITY = SERIAL_PARITY_SPACE;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_MAX_FLOW = SERIAL_FLOW_DSR_DTR;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''PL2303 device model''' <code> PL2303_TYPE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL2303_TYPE_01 = 0;</code>
 +
| Type 0 and 1 (difference unknown)
 +
|-
 +
| <code>PL2303_TYPE_HX = 1;</code>
 +
| HX version of the PL2303 chip
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''PL2303 bulk in/out size''' <code> PL2303_BULK_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL2303_BULK_IN_SIZE = 256;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>PL2303_BULK_OUT_SIZE = 256;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''PL2303 USB request''' <code> PL2303_*_REQUEST </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL2303_SET_LINE_REQUEST_TYPE = $21;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>PL2303_SET_LINE_REQUEST = $20;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_SET_CONTROL_REQUEST_TYPE = $21;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SET_CONTROL_REQUEST = $22;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_CONTROL_DTR = $01;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_CONTROL_RTS = $02;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_BREAK_REQUEST_TYPE = $21;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_BREAK_REQUEST = $23;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_BREAK_ON = $ffff;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_BREAK_OFF = $0000;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_GET_LINE_REQUEST_TYPE = $a1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_GET_LINE_REQUEST = $21;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_VENDOR_WRITE_REQUEST_TYPE = $40;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_VENDOR_WRITE_REQUEST = $01;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_VENDOR_READ_REQUEST_TYPE = $c0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_VENDOR_READ_REQUEST = $01;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_UART_STATE_INDEX = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_UART_DCD = $01;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_UART_DSR = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_UART_BREAK_ERROR = $04;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_UART_RING = $08;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_UART_FRAME_ERROR = $10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_UART_PARITY_ERROR = $20;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_UART_OVERRUN_ERROR = $40;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_UART_CTS = $80;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_UART_STATE_MSR_MASK = PL2303_UART_DCD or PL2303_UART_DSR or PL2303_UART_RING or PL2303_UART_CTS;</code>
 +
| $8b
 +
|-
 +
| <code>PL2303_UART_STATE_TRANSIENT_MASK = PL2303_UART_BREAK_ERROR or PL2303_UART_FRAME_ERROR or PL2303_UART_PARITY_ERROR or PL2303_UART_OVERRUN_ERROR;</code>
 +
| $74
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''PL2303 device quirk''' <code> PL2303_QUIRK_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL2303_QUIRK_NONE = $00000000;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>PL2303_QUIRK_UART_STATE_IDX0 = $00000001;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_QUIRK_LEGACY = $00000002;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_QUIRK_ENDPOINT_HACK = $00000004;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''PL2303 supported baud rate''' <code> PL2303_SUPPORTED_BAUD_RATE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL2303_SUPPORTED_BAUD_RATE_COUNT = 25;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<code>PL2303_SUPPORTED_BAUD_RATES:array[0..PL2303_SUPPORTED_BAUD_RATE_COUNT - 1] of LongWord = (</code>
 +
|-
 +
| <code>75,</code>
 +
| &nbsp;
 +
|-
 +
| <code>150,</code>
 +
| &nbsp;
 +
|-
 +
| <code>300,</code>
 +
| &nbsp;
 +
|-
 +
| <code>600,</code>
 +
| &nbsp;
 +
|-
 +
| <code>1200,</code>
 +
| &nbsp;
 +
|-
 +
| <code>1800,</code>
 +
| &nbsp;
 +
|-
 +
| <code>2400,</code>
 +
| &nbsp;
 +
|-
 +
| <code>3600,</code>
 +
| &nbsp;
 +
|-
 +
| <code>4800,</code>
 +
| &nbsp;
 +
|-
 +
| <code>7200,</code>
 +
| &nbsp;
 +
|-
 +
| <code>9600,</code>
 +
| &nbsp;
 +
|-
 +
| <code>14400,</code>
 +
| &nbsp;
 +
|-
 +
| <code>19200,</code>
 +
| &nbsp;
 +
|-
 +
| <code>28800,</code>
 +
| &nbsp;
 +
|-
 +
| <code>38400,</code>
 +
| &nbsp;
 +
|-
 +
| <code>57600,</code>
 +
| &nbsp;
 +
|-
 +
| <code>115200,</code>
 +
| &nbsp;
 +
|-
 +
| <code>230400,</code>
 +
| &nbsp;
 +
|-
 +
| <code>460800,</code>
 +
| &nbsp;
 +
|-
 +
| <code>614400,</code>
 +
| &nbsp;
 +
|-
 +
| <code>921600,</code>
 +
| &nbsp;
 +
|-
 +
| <code>1228800,</code>
 +
| &nbsp;
 +
|-
 +
| <code>2457600,</code>
 +
| &nbsp;
 +
|-
 +
| <code>3000000,</code>
 +
| &nbsp;
 +
|-
 +
| <code>6000000);</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''PL2303 vendor and product Id''' <code> PL2303_*_ID </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL2303_VENDOR_ID = $067b;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID = $2303;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_TB = $2304;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_RSAQ2 = $04bb;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_DCU11 = $1234;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_PHAROS = $aaa0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_RSAQ3 = $aaa2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_CHILITAG = $aaa8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_ALDIGA = $0611;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_MMX = $0612;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_GPRS = $0609;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_HCR331 = $331a;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_MOTOROLA = $0307;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_PRODUCT_ID_ZTEK = $e1f1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_ATEN_VENDOR_ID = $0557;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ATEN_VENDOR_ID2 = $0547;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ATEN_PRODUCT_ID = $2008;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ATEN_PRODUCT_UC485 = $2021;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ATEN_PRODUCT_UC232B = $2022;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ATEN_PRODUCT_ID2 = $2118;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_BENQ_VENDOR_ID = $04a5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_BENQ_PRODUCT_ID_S81 = $4027;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_IODATA_VENDOR_ID = $04bb;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_IODATA_PRODUCT_ID = $0a03;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_IODATA_PRODUCT_ID_RSAQ5 = $0a0e;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_ELCOM_VENDOR_ID = $056e;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ELCOM_PRODUCT_ID = $5003;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ELCOM_PRODUCT_ID_UCSGT = $5004;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_ITEGNO_VENDOR_ID = $0eba;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ITEGNO_PRODUCT_ID = $1080;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ITEGNO_PRODUCT_ID_2080 = $2080;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_MA620_VENDOR_ID = $0df7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_MA620_PRODUCT_ID = $0620;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_RATOC_VENDOR_ID = $0584;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_RATOC_PRODUCT_ID = $b000;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_TRIPP_VENDOR_ID = $2478;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_TRIPP_PRODUCT_ID = $2008;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_RADIOSHACK_VENDOR_ID = $1453;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_RADIOSHACK_PRODUCT_ID = $4026;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_DCU10_VENDOR_ID = $0731;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_DCU10_PRODUCT_ID = $0528;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_SITECOM_VENDOR_ID = $6189;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SITECOM_PRODUCT_ID = $2068;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Alcatel OT535/735 USB cable''
 +
|-
 +
| <code>PL2303_ALCATEL_VENDOR_ID = $11f7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ALCATEL_PRODUCT_ID = $02df;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_SIEMENS_VENDOR_ID = $11f5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SIEMENS_PRODUCT_ID_SX1 = $0001;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SIEMENS_PRODUCT_ID_X65 = $0003;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SIEMENS_PRODUCT_ID_X75 = $0004;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SIEMENS_PRODUCT_ID_EF81 = $0005;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_SYNTECH_VENDOR_ID = $0745;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SYNTECH_PRODUCT_ID = $0001;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Nokia CA-42 Cable''
 +
|-
 +
| <code>PL2303_NOKIA_CA42_VENDOR_ID = $078b;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_NOKIA_CA42_PRODUCT_ID = $1234;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''CA-42 CLONE Cable www.ca-42.com chipset: Prolific Technology Inc''
 +
|-
 +
| <code>PL2303_CA_42_CA42_VENDOR_ID = $10b5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_CA_42_CA42_PRODUCT_ID = $ac70;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PL2303_SAGEM_VENDOR_ID = $079b;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SAGEM_PRODUCT_ID = $0027;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Leadtek GPS 9531 (ID 0413:2101)''
 +
|-
 +
| <code>PL2303_LEADTEK_VENDOR_ID = $0413;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_LEADTEK_9531_PRODUCT_ID = $2101;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''USB GSM cable from Speed Dragon Multimedia, Ltd''
 +
|-
 +
| <code>PL2303_SPEEDDRAGON_VENDOR_ID = $0e55;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SPEEDDRAGON_PRODUCT_ID = $110b;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''DATAPILOT Universal-2 Phone Cable''
 +
|-
 +
| <code>PL2303_DATAPILOT_U2_VENDOR_ID = $0731;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_DATAPILOT_U2_PRODUCT_ID = $2003;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Belkin "F5U257" Serial Adapter''
 +
|-
 +
| <code>PL2303_BELKIN_VENDOR_ID = $050d;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_BELKIN_PRODUCT_ID = $0257;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Alcor Micro Corp. USB 2.0 TO RS-232''
 +
|-
 +
| <code>PL2303_ALCOR_VENDOR_ID = $058F;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ALCOR_PRODUCT_ID = $9720;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Willcom WS002IN Data Driver (by NetIndex Inc.)
 +
|-
 +
| <code>PL2303_WS002IN_VENDOR_ID = $11f6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_WS002IN_PRODUCT_ID = $2001;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Corega CG-USBRS232R Serial Adapter''
 +
|-
 +
| <code>PL2303_COREGA_VENDOR_ID = $07aa;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_COREGA_PRODUCT_ID = $002a;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Y.C. Cable U.S.A., Inc - USB to RS-232''
 +
|-
 +
| <code>PL2303_YCCABLE_VENDOR_ID = $05ad;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_YCCABLE_PRODUCT_ID = $0fba;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''"Superial" USB - Serial''
 +
|-
 +
| <code>PL2303_SUPERIAL_VENDOR_ID = $5372;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SUPERIAL_PRODUCT_ID = $2303;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Hewlett-Packard POS Pole Displays''
 +
|-
 +
| <code>PL2303_HP_VENDOR_ID = $03f0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_HP_LM920_PRODUCT_ID = $026b;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_HP_TD620_PRODUCT_ID = $0956;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_HP_LD960_PRODUCT_ID = $0b39;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_HP_LCM220_PRODUCT_ID = $3139;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_HP_LCM960_PRODUCT_ID = $3239;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_HP_LD220_PRODUCT_ID = $3524;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_HP_LD220TA_PRODUCT_ID = $4349;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_HP_LD960TA_PRODUCT_ID = $4439;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_HP_LM940_PRODUCT_ID = $5039;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Cressi Edy (diving computer) PC interface''
 +
|-
 +
| <code>PL2303_CRESSI_VENDOR_ID = $04b8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_CRESSI_EDY_PRODUCT_ID = $0521;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Zeagle dive computer interface''
 +
|-
 +
| <code>PL2303_ZEAGLE_VENDOR_ID = $04b8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ZEAGLE_N2ITION3_PRODUCT_ID = $0522;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Sony, USB data cable for CMD-Jxx mobile phones''
 +
|-
 +
| <code>PL2303_SONY_VENDOR_ID = $054c;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SONY_QN3USB_PRODUCT_ID = $0437;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Sanwa KB-USB2 multimeter cable (ID: 11ad:0001)''
 +
|-
 +
| <code>PL2303_SANWA_VENDOR_ID = $11ad;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SANWA_PRODUCT_ID = $0001;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''ADLINK ND-6530 RS232,RS485 and RS422 adapter''
 +
|-
 +
| <code>PL2303_ADLINK_VENDOR_ID = $0b63;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_ADLINK_ND6530_PRODUCT_ID = $6530;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''SMART USB Serial Adapter''
 +
|-
 +
| <code>PL2303_SMART_VENDOR_ID = $0b8c;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PL2303_SMART_PRODUCT_ID = $2303;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''PL2303 device Id''' <code> PL2303_DEVICE_ID_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PL2303_DEVICE_ID_COUNT = 64;</code>
 +
| Number of supported Device IDs
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|&nbsp;<code>PL2303_DEVICE_ID:array[0..PL2303_DEVICE_ID_COUNT - 1] of TUSBDeviceId = (</code>
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_RSAQ2),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_DCU11),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_RSAQ3),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_CHILITAG),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_PHAROS),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_ALDIGA),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_MMX),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_GPRS),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_HCR331),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_MOTOROLA),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_ZTEK),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_VENDOR_ID;idProduct:PL2303_PRODUCT_ID_TB),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_IODATA_VENDOR_ID;idProduct:PL2303_IODATA_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_IODATA_VENDOR_ID;idProduct:PL2303_IODATA_PRODUCT_ID_RSAQ5),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ATEN_VENDOR_ID;idProduct:PL2303_ATEN_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ATEN_VENDOR_ID;idProduct:PL2303_ATEN_PRODUCT_UC485),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ATEN_VENDOR_ID;idProduct:PL2303_ATEN_PRODUCT_UC232B),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ATEN_VENDOR_ID;idProduct:PL2303_ATEN_PRODUCT_ID2),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ATEN_VENDOR_ID2;idProduct:PL2303_ATEN_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ELCOM_VENDOR_ID;idProduct:PL2303_ELCOM_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ELCOM_VENDOR_ID;idProduct:PL2303_ELCOM_PRODUCT_ID_UCSGT),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ITEGNO_VENDOR_ID;idProduct:PL2303_ITEGNO_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ITEGNO_VENDOR_ID;idProduct:PL2303_ITEGNO_PRODUCT_ID_2080),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_MA620_VENDOR_ID;idProduct:PL2303_MA620_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_RATOC_VENDOR_ID;idProduct:PL2303_RATOC_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_TRIPP_VENDOR_ID;idProduct:PL2303_TRIPP_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
|<code>(idVendor:PL2303_RADIOSHACK_VENDOR_ID;idProduct:PL2303_RADIOSHACK_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_DCU10_VENDOR_ID;idProduct:PL2303_DCU10_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_SITECOM_VENDOR_ID;idProduct:PL2303_SITECOM_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ALCATEL_VENDOR_ID;idProduct:PL2303_ALCATEL_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_SIEMENS_VENDOR_ID;idProduct:PL2303_SIEMENS_PRODUCT_ID_SX1),</code>
 +
| PL2303_QUIRK_UART_STATE_IDX0
 +
|-
 +
| <code>(idVendor:PL2303_SIEMENS_VENDOR_ID;idProduct:PL2303_SIEMENS_PRODUCT_ID_X65),</code>
 +
| PL2303_QUIRK_UART_STATE_IDX0
 +
|-
 +
| <code>(idVendor:PL2303_SIEMENS_VENDOR_ID;idProduct:PL2303_SIEMENS_PRODUCT_ID_X75),</code>
 +
| PL2303_QUIRK_UART_STATE_IDX0
 +
|-
 +
| <code>(idVendor:PL2303_SIEMENS_VENDOR_ID;idProduct:PL2303_SIEMENS_PRODUCT_ID_EF81),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_BENQ_VENDOR_ID;idProduct:PL2303_BENQ_PRODUCT_ID_S81),</code>
 +
| Benq/Siemens S81
 +
|-
 +
| <code>(idVendor:PL2303_SYNTECH_VENDOR_ID;idProduct:PL2303_SYNTECH_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_NOKIA_CA42_VENDOR_ID;idProduct:PL2303_NOKIA_CA42_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_CA_42_CA42_VENDOR_ID;idProduct:PL2303_CA_42_CA42_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_SAGEM_VENDOR_ID;idProduct:PL2303_SAGEM_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_LEADTEK_VENDOR_ID;idProduct:PL2303_LEADTEK_9531_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_SPEEDDRAGON_VENDOR_ID;idProduct:PL2303_SPEEDDRAGON_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_DATAPILOT_U2_VENDOR_ID;idProduct:PL2303_DATAPILOT_U2_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_BELKIN_VENDOR_ID;idProduct:PL2303_BELKIN_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ALCOR_VENDOR_ID;idProduct:PL2303_ALCOR_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_WS002IN_VENDOR_ID;idProduct:PL2303_WS002IN_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_COREGA_VENDOR_ID;idProduct:PL2303_COREGA_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_YCCABLE_VENDOR_ID;idProduct:PL2303_YCCABLE_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_SUPERIAL_VENDOR_ID;idProduct:PL2303_SUPERIAL_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_HP_VENDOR_ID;idProduct:PL2303_HP_LD220_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_HP_VENDOR_ID;idProduct:PL2303_HP_LD220TA_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_HP_VENDOR_ID;idProduct:PL2303_HP_LD960_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_HP_VENDOR_ID;idProduct:PL2303_HP_LD960TA_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_HP_VENDOR_ID;idProduct:PL2303_HP_LCM220_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_HP_VENDOR_ID;idProduct:PL2303_HP_LCM960_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_HP_VENDOR_ID;idProduct:PL2303_HP_LM920_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_HP_VENDOR_ID;idProduct:PL2303_HP_LM940_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_HP_VENDOR_ID;idProduct:PL2303_HP_TD620_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_CRESSI_VENDOR_ID;idProduct:PL2303_CRESSI_EDY_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ZEAGLE_VENDOR_ID;idProduct:PL2303_ZEAGLE_N2ITION3_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_SONY_VENDOR_ID;idProduct:PL2303_SONY_QN3USB_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_SANWA_VENDOR_ID;idProduct:PL2303_SANWA_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_ADLINK_VENDOR_ID;idProduct:PL2303_ADLINK_ND6530_PRODUCT_ID),</code>
 +
| &nbsp;
 +
|-
 +
| <code>(idVendor:PL2303_SMART_VENDOR_ID;idProduct:PL2303_SMART_PRODUCT_ID));</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===
 
----
 
----
  
''To be documented''
+
 
 +
'''PL2303 specific types'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PPL2303SerialDevice = ^TPL2303SerialDevice;</code>
 +
 
 +
<code>TPL2303SerialDevice = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Serial Properties''
 +
|-
 +
| <code>Serial:TSerialDevice;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''USB Properties''
 +
|-
 +
| <code>Model:LongWord;</code>
 +
| Device model (eg PL2303_TYPE_01)
 +
|-
 +
| <code>Quirks:LongWord;</code>
 +
| Unusual behaviours of specific chip versions
 +
|-
 +
| <code>Control:LongWord;</code>
 +
| Status of the control lines RTS and DTR
 +
|-
 +
| <code>ReceiveSize:LongWord;</code>
 +
| Maximum Receive size for Bulk IN Endpoint
 +
|-
 +
| <code>TransmitSize:LongWord;</code>
 +
| Maximum Transmit size for Bulk OUT Endpoint
 +
|-
 +
| <code>ReceiveActive:LongBool;</code>
 +
| True if a Receive request is currently in progress
 +
|-
 +
| <code>TransmitActive:LongBool;</code>
 +
| True if a Transmit request is currently in progress
 +
|-
 +
| <code>ReceiveRequest:PUSBRequest;</code>
 +
| USB request Bulk IN Endpoint
 +
|-
 +
| <code>ReceiveEndpoint:PUSBEndpointDescriptor;</code>
 +
| PL2303 Bulk IN Endpoint
 +
|-
 +
| <code>TransmitRequest:PUSBRequest;</code>
 +
| USB request for Bulk OUT Endpoint
 +
|-
 +
| <code>TransmitEndpoint:PUSBEndpointDescriptor;</code>
 +
| PL2303 Bulk OUT Endpoint
 +
|-
 +
| <code>InterruptRequest:PUSBRequest;</code>
 +
| USB request for Interrupt IN Endpoint
 +
|-
 +
| <code>InterruptEndpoint:PUSBEndpointDescriptor;</code>
 +
| PL2303 Interrupt IN Endpoint
 +
|-
 +
| <code>PendingCount:LongWord;</code>
 +
| Number of USB requests pending for this device
 +
|-
 +
| <code>WaiterThread:TThreadId;</code>
 +
| Thread waiting for pending requests to complete (for device detachment)
 +
|-
 +
|colspan="2"|''Statistics Properties''
 +
|-
 +
| <code>ReceiveComplete:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TransmitComplete:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>InterruptComplete:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>InterruptErrors:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
  
''To be documented''
+
''None defined''
  
 
=== Function declarations ===
 
=== Function declarations ===
 
----
 
----
  
''To be documented''
 
  
 +
'''Initialization functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure PL2303Init;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''PL2303 serial functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303SerialDeviceOpen(Serial:PSerialDevice; BaudRate,DataBits,StopBits,Parity,FlowControl,ReceiveDepth,TransmitDepth:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SerialDeviceOpen API for PL2303 Serial</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use SerialDeviceOpen instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303SerialDeviceClose(Serial:PSerialDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SerialDeviceClose API for PL2303 Serial</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use SerialDeviceClose instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303SerialDeviceRead(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SerialDeviceRead API for PL2303 Serial</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use SerialDeviceRead instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303SerialDeviceWrite(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SerialDeviceWrite API for Pl2303 Serial</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use SerialDeviceWrite instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''PL2303 USB functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303DriverBind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Bind the PL2303 driver to a USB device if it is suitable</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Device
 +
| The USB device to attempt to bind to
 +
|-
 +
! Interrface
 +
| The USB interface to attempt to bind to (or nil for whole device)
 +
|-
 +
! Return
 +
| USB_STATUS_SUCCESS if completed, USB_STATUS_DEVICE_UNSUPPORTED if unsupported or another error code on failure.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303DriverUnbind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unbind the PL2303 driver from a USB device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Device
 +
| The USB device to unbind from
 +
|-
 +
! Interrface
 +
| The USB interface to unbind from (or nil for whole device)
 +
|-
 +
! Return
 +
| USB_STATUS_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure PL2303ReceiveStart(Request:PUSBRequest);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called to continue reception of data to the receive buffer</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Request
 +
| The USB receive request to use
 +
|-
 +
! Note
 +
| Caller must hold the lock on the serial device
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure PL2303ReceiveWorker(Request:PUSBRequest);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called (by a Worker thread) to process a completed USB request from the PL2303 bulk IN endpoint</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Request
 +
| The USB request which has completed
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure PL2303ReceiveComplete(Request:PUSBRequest);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called when a USB request from the PL2303 bulk IN endpoint completes</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Request
 +
| The USB request which has completed
 +
|-
 +
! Note
 +
| Request is passed to worker thread for processing to prevent blocking the USB completion
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure PL2303TransmitStart(Request:PUSBRequest);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called to continue transmission of data from the transmit buffer</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Request
 +
| The USB transmit request to use
 +
|-
 +
! Note
 +
| Caller must hold the lock on the serial device
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure PL2303TransmitWorker(Request:PUSBRequest);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called (by a Worker thread) to process a completed USB request to the PL2303 bulk OUT endpoint</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Request
 +
| The USB request which has completed
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure PL2303TransmitComplete(Request:PUSBRequest);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called when a USB request to the PL2303 bulk OUT endpoint completes</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Request
 +
| The USB request which has completed
 +
|-
 +
! Note
 +
| Request is passed to worker thread for processing to prevent blocking the USB completion
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure PL2303InterruptWorker(Request:PUSBRequest);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called (by a Worker thread) to process a completed USB request to the PL2303 interrupt IN endpoint</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Request
 +
| The USB request which has completed
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure PL2303InterruptComplete(Request:PUSBRequest);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called when a USB request from the PL2303 interrupt IN endpoint completes</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Request
 +
| The USB request which has completed
 +
|-
 +
! Note
 +
| Request is passed to worker thread for processing to prevent blocking the USB completion
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''PL2303 helper functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303CheckDevice(Device:PUSBDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check the Vendor and Device ID against the supported devices</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Device
 +
| USB device to check
 +
|-
 +
! Return
 +
| USB_STATUS_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />   
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303PatchDevice(Device:PUSBDevice; var Model,Quirks:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check the USB device for quirks and model information needed by the driver</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Device
 +
| USB device to check
 +
|-
 +
! Return
 +
| USB_STATUS_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303VendorRead(Device:PUSBDevice; Value:Word; Data:PByte):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a vendor read request to a PL2303 device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303VendorWrite(Device:PUSBDevice; Value,Index:Word):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a vendor write request to a PL2303 device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303GetLineRequest(Device:PUSBDevice; Data:PByte):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a get line request to a PL2303 device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303SetLineRequest(Device:PUSBDevice; Data:PByte):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a set line request to a PL2303 device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303SetControlRequest(Device:PUSBDevice; Value:Word):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a set control request to a PL2303 device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303EncodeBaudRate(Device:PUSBDevice; BaudRate:LongWord; Data:PByte):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Encode a baud rate value into the Line Request buffer for a PL2303 device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PL2303GetSupportedRate(BaudRate:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
Return to [[Unit_Reference|Unit Reference]]
 
Return to [[Unit_Reference|Unit Reference]]

Latest revision as of 04:32, 9 May 2019

Return to Unit Reference


Description


Prolific PL2303 USB to Serial Driver unit

The Prolific PL2303 is a USB to serial interface chip used by multiple vendors.

It includes a single serial port with bulk IN and OUT plus interrupt IN endpoints.

Constants



[Expand]
PL2303 specific constants PL2303_*


[Expand]
PL2303 device model PL2303_TYPE_*


[Expand]
PL2303 bulk in/out size PL2303_BULK_*


[Expand]
PL2303 USB request PL2303_*_REQUEST


[Expand]
PL2303 device quirk PL2303_QUIRK_*


[Expand]
PL2303 supported baud rate PL2303_SUPPORTED_BAUD_RATE_*


[Expand]
PL2303 vendor and product Id PL2303_*_ID


[Expand]
PL2303 device Id PL2303_DEVICE_ID_*


Type definitions



PL2303 specific types

[Expand]

PPL2303SerialDevice = ^TPL2303SerialDevice;

TPL2303SerialDevice = record


Public variables


None defined

Function declarations



Initialization functions

[Expand]
procedure PL2303Init;
Description: To be documented


PL2303 serial functions

[Expand]
function PL2303SerialDeviceOpen(Serial:PSerialDevice; BaudRate,DataBits,StopBits,Parity,FlowControl,ReceiveDepth,TransmitDepth:LongWord):LongWord;
Description: Implementation of SerialDeviceOpen API for PL2303 Serial


[Expand]
function PL2303SerialDeviceClose(Serial:PSerialDevice):LongWord;
Description: Implementation of SerialDeviceClose API for PL2303 Serial


[Expand]
function PL2303SerialDeviceRead(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
Description: Implementation of SerialDeviceRead API for PL2303 Serial


[Expand]
function PL2303SerialDeviceWrite(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
Description: Implementation of SerialDeviceWrite API for Pl2303 Serial


PL2303 USB functions

[Expand]
function PL2303DriverBind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Description: Bind the PL2303 driver to a USB device if it is suitable


[Expand]
function PL2303DriverUnbind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Description: Unbind the PL2303 driver from a USB device


[Expand]
procedure PL2303ReceiveStart(Request:PUSBRequest);
Description: Called to continue reception of data to the receive buffer


[Expand]
procedure PL2303ReceiveWorker(Request:PUSBRequest);
Description: Called (by a Worker thread) to process a completed USB request from the PL2303 bulk IN endpoint


[Expand]
procedure PL2303ReceiveComplete(Request:PUSBRequest);
Description: Called when a USB request from the PL2303 bulk IN endpoint completes


[Expand]
procedure PL2303TransmitStart(Request:PUSBRequest);
Description: Called to continue transmission of data from the transmit buffer


[Expand]
procedure PL2303TransmitWorker(Request:PUSBRequest);
Description: Called (by a Worker thread) to process a completed USB request to the PL2303 bulk OUT endpoint


[Expand]
procedure PL2303TransmitComplete(Request:PUSBRequest);
Description: Called when a USB request to the PL2303 bulk OUT endpoint completes


[Expand]
procedure PL2303InterruptWorker(Request:PUSBRequest);
Description: Called (by a Worker thread) to process a completed USB request to the PL2303 interrupt IN endpoint


[Expand]
procedure PL2303InterruptComplete(Request:PUSBRequest);
Description: Called when a USB request from the PL2303 interrupt IN endpoint completes


PL2303 helper functions

[Expand]
function PL2303CheckDevice(Device:PUSBDevice):LongWord;
Description: Check the Vendor and Device ID against the supported devices


[Expand]
function PL2303PatchDevice(Device:PUSBDevice; var Model,Quirks:LongWord):LongWord;
Description: Check the USB device for quirks and model information needed by the driver


[Expand]
function PL2303VendorRead(Device:PUSBDevice; Value:Word; Data:PByte):LongWord;
Description: Perform a vendor read request to a PL2303 device


[Expand]
function PL2303VendorWrite(Device:PUSBDevice; Value,Index:Word):LongWord;
Description: Perform a vendor write request to a PL2303 device


[Expand]
function PL2303GetLineRequest(Device:PUSBDevice; Data:PByte):LongWord;
Description: Perform a get line request to a PL2303 device


[Expand]
function PL2303SetLineRequest(Device:PUSBDevice; Data:PByte):LongWord;
Description: Perform a set line request to a PL2303 device


[Expand]
function PL2303SetControlRequest(Device:PUSBDevice; Value:Word):LongWord;
Description: Perform a set control request to a PL2303 device


[Expand]
function PL2303EncodeBaudRate(Device:PUSBDevice; BaudRate:LongWord; Data:PByte):LongWord;
Description: Encode a baud rate value into the Line Request buffer for a PL2303 device


[Expand]
function PL2303GetSupportedRate(BaudRate:LongWord):LongWord;
Description: To be documented


Return to Unit Reference