Difference between revisions of "Unit USBCDCACM"

From Ultibo.org
Jump to: navigation, search
Line 108: Line 108:
 
|-
 
|-
 
| <code>CDCACM_QUIRK_SEND_ZERO_PACKET = $00000080;</code>
 
| <code>CDCACM_QUIRK_SEND_ZERO_PACKET = $00000080;</code>
 +
| &nbsp;
 +
|-
 +
| <code>CDCACM_QUIRK_DISABLE_ECHO = $00000100;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
Line 118: Line 121:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
| <code>CDCACM_DEVICE_ID_COUNT = 39;</code>
+
| <code>CDCACM_DEVICE_ID_COUNT = 49;</code>
 
| Number of supported Device IDs
 
| Number of supported Device IDs
 
|-
 
|-
Line 136: Line 139:
 
| <code>(idVendor:$0e8d;idProduct:$0003;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 
| <code>(idVendor:$0e8d;idProduct:$0003;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 
| FIREFLY, MediaTek Inc (has no union descriptor)
 
| FIREFLY, MediaTek Inc (has no union descriptor)
 +
|-
 +
| <code>(idVendor:$0e8d;idProduct:$2000;Quirks:CDCACM_QUIRK_DISABLE_ECHO),</code>
 +
| MediaTek Inc Preloader
 
|-
 
|-
 
| <code>(idVendor:$0e8d;idProduct:$3329;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 
| <code>(idVendor:$0e8d;idProduct:$3329;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
Line 154: Line 160:
 
| <code>(idVendor:$0ace;idProduct:$1611;Quirks:CDCACM_QUIRK_SINGLE_RX_URB),</code>
 
| <code>(idVendor:$0ace;idProduct:$1611;Quirks:CDCACM_QUIRK_SINGLE_RX_URB),</code>
 
| ZyDAS 56K USB MODEM - new version (firmware bug)
 
| ZyDAS 56K USB MODEM - new version (firmware bug)
 +
|-
 +
| <code>(idVendor:$11ca;idProduct:$0201;Quirks:CDCACM_QUIRK_SINGLE_RX_URB),</code>
 +
| VeriFone Mx870 Gadget Serial
 +
|-
 +
| <code>(idVendor:$1965;idProduct:$0018;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 +
| Uniden UBC125XLT
 
|-
 
|-
 
| <code>(idVendor:$22b8;idProduct:$7000;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 
| <code>(idVendor:$22b8;idProduct:$7000;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
Line 169: Line 181:
 
| <code>(idVendor:$0572;idProduct:$1328;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 
| <code>(idVendor:$0572;idProduct:$1328;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 
| Shiro/Aztech USB MODEM UM-3100 (has no union descriptor)
 
| Shiro/Aztech USB MODEM UM-3100 (has no union descriptor)
 +
|-
 +
| <code>(idVendor:$0572;idProduct:$1349;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 +
| Hiro (Conexant) USB MODEM H50228
 
|-
 
|-
 
| <code>(idVendor:$20df;idProduct:$0001;Quirks:CDCACM_QUIRK_CONTROL_LINE_STATE),</code>
 
| <code>(idVendor:$20df;idProduct:$0001;Quirks:CDCACM_QUIRK_CONTROL_LINE_STATE),</code>
Line 175: Line 190:
 
| <code>(idVendor:$2184;idProduct:$001c;Quirks:CDCACM_QUIRK_NONE),</code>
 
| <code>(idVendor:$2184;idProduct:$001c;Quirks:CDCACM_QUIRK_NONE),</code>
 
| GW Instek AFG-2225
 
| GW Instek AFG-2225
 +
|-
 +
| <code>(idVendor:$2184;idProduct:$0036;Quirks:CDCACM_QUIRK_NONE),</code>
 +
| GW Instek AFG-125
 
|-
 
|-
 
| <code>(idVendor:$22b8;idProduct:$6425;Quirks:CDCACM_QUIRK_NONE),</code>
 
| <code>(idVendor:$22b8;idProduct:$6425;Quirks:CDCACM_QUIRK_NONE),</code>
Line 219: Line 237:
 
| <code>(idVendor:$1576;idProduct:$03b1;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 
| <code>(idVendor:$1576;idProduct:$03b1;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 
| Maretron USB100 (reports zero length descriptor)
 
| Maretron USB100 (reports zero length descriptor)
 +
|-
 +
| <code>(idVendor:$fff0;idProduct:$0100;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 +
| DATECS FP-2000
 +
|-
 +
| <code>(idVendor:$09d8;idProduct:$0320;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 +
| Elatec GmbH TWN3
 +
|-
 +
| <code>(idVendor:$0ca6;idProduct:$a050;Quirks:CDCACM_QUIRK_NO_UNION_NORMAL),</code>
 +
| Castles VEGA3000
 
|-
 
|-
 
| <code>(idVendor:$2912;idProduct:$0001;Quirks:CDCACM_QUIRK_CLEAR_HALT_CONDITIONS),</code>
 
| <code>(idVendor:$2912;idProduct:$0001;Quirks:CDCACM_QUIRK_CLEAR_HALT_CONDITIONS),</code>
Line 248: Line 275:
 
| <code>(idVendor:$058b;idProduct:$0041;Quirks:CDCACM_QUIRK_IGNORE_DEVICE),</code>
 
| <code>(idVendor:$058b;idProduct:$0041;Quirks:CDCACM_QUIRK_IGNORE_DEVICE),</code>
 
| &nbsp;
 
| &nbsp;
 +
|-
 +
| <code>(idVendor:$1bc7;idProduct:$0021;Quirks:CDCACM_QUIRK_SEND_ZERO_PACKET),</code>
 +
| Telit 3G ACM only composition
 +
|-
 +
| <code>(idVendor:$1bc7;idProduct:$0023;Quirks:CDCACM_QUIRK_SEND_ZERO_PACKET),</code>
 +
| Telit 3G ACM + ECM composition
 
|-
 
|-
 
| <code>(idVendor:$1519;idProduct:$0452;Quirks:CDCACM_QUIRK_SEND_ZERO_PACKET));</code>
 
| <code>(idVendor:$1519;idProduct:$0452;Quirks:CDCACM_QUIRK_SEND_ZERO_PACKET));</code>

Revision as of 03:51, 10 May 2019

Return to Unit Reference


Description


USB CDC ACM Driver unit

The Abstract Control Model (ACM) is part of the USB Communications Device Class (CDC) standard which allows modem like devices to be supported by USB with a standardized protocol for data transfer and modem control.

A CDC ACM device is defined by information in the interface descriptors and is not specific to any product and vendor Id. There are numerous devices that support the CDC ACM protocol and some of the most important from Ultibo are the Arduino Mega 2560 R3 and the Arduino Due.

This driver presents any device recognized as a CDC ACM as a generic serial interface device that can be accessed using the API in the Serial unit. It should not be necessary to directly call any of the functions in this unit from application code.

Constants



[Expand]
CDC ACM specific constants CDCACM_*


[Expand]
CDC ACM USB request CDCACM_USB_REQUEST_*


[Expand]
CDC ACM device quirk CDCACM_QUIRK_*


[Expand]
CDC ACM device Id CDCACM_DEVICE_ID_*


[Expand]
CDC ACM interface Id CDCACM_INTERFACE_ID_*


[Expand]
CDC ACM device and interface Id CDCACM_DEVICE_INTERFACE_ID_*


Type definitions



CDC ACM device Id

[Expand]

PCDCACMDeviceId = ^TCDCACMDeviceId;

TCDCACMDeviceId = record

CDC ACM device

[Expand]

PCDCACMDevice = ^TCDCACMDevice;

TCDCACMDevice = record


Public variables


None defined

Function declarations



Initialization functions

[Expand]
procedure CDCACMInit;
Description: To be documented


CDC ACM serial functions

[Expand]
function CDCACMSerialDeviceOpen(Serial:PSerialDevice; BaudRate,DataBits,StopBits,Parity,FlowControl,ReceiveDepth,TransmitDepth:LongWord):LongWord;
Description: To be documented


[Expand]
function CDCACMSerialDeviceClose(Serial:PSerialDevice):LongWord;
Description: To be documented


[Expand]
function CDCACMSerialDeviceRead(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
Description: To be documented


[Expand]
function CDCACMSerialDeviceWrite(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
Description: To be documented


CDC ACM USB functions

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


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


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


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


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


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


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


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


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


CDC ACM helper functions

[Expand]
function CDCACMCheckDevice(Device:PUSBDevice; var Quirks:LongWord):LongWord;
Description: Check the Vendor and Device Id against the supported devices


[Expand]
function CDCACMCheckInterface(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Description: Check the Interface against the supported devices


[Expand]
function CDCACMCheckDeviceAndInterface(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Description: Check the Device and Interface against the supported devices


[Expand]
function CDCACMFindInterfaces(Device:PUSBDevice; Interrface:PUSBInterface; var DataInterface,ControlInterface:PUSBInterface; Quirks:LongWord; var Capabilities:Byte):LongWord;
Description: Locate the data and control interfaces from the functional descriptors


[Expand]
function CDCACMControlRequest(Serial:PCDCACMDevice; Request:Byte; Value:Word; Data:Pointer;Size:Word):LongWord;
Description: To be documented


[Expand]
function CDCACMGetLineRequest(Serial:PCDCACMDevice; var LineCoding:TUSBCDCLineCoding):LongWord;
Description: To be documented


[Expand]
function CDCACMSetLineRequest(Serial:PCDCACMDevice; const LineCoding:TUSBCDCLineCoding):LongWord;
Description: To be documented


[Expand]
function CDCACMSetControlRequest(Serial:PCDCACMDevice; Control:Word):LongWord;
Description: To be documented


Return to Unit Reference