Difference between revisions of "Unit USBCDCACM"
Line 226: | Line 226: | ||
! '''Note''' | ! '''Note''' | ||
| Request is passed to worker thread for processing to prevent blocking the USB completion | | Request is passed to worker thread for processing to prevent blocking the USB completion | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''CDC ACM 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 CDCACMCheckDevice(Device:PUSBDevice; var Quirks:LongWord):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 | ||
+ | |- | ||
+ | ! '''Quirks''' | ||
+ | | Return value for any device specific quirks (eg CDCACM_QUIRK_NO_UNION_NORMAL) | ||
+ | |- | ||
+ | ! '''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 CDCACMCheckInterface(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check the Interface 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 | ||
+ | |- | ||
+ | ! '''Interrface''' | ||
+ | | USB interface 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 CDCACMCheckDeviceAndInterface(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check the Device and Interface 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 | ||
+ | |- | ||
+ | ! '''Interrface''' | ||
+ | | USB interface 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 CDCACMFindInterfaces(Device:PUSBDevice; Interrface:PUSBInterface; var DataInterface,ControlInterface:PUSBInterface; Quirks:LongWord; var Capabilities:Byte):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Locate the data and control interfaces from the functional descriptors</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 | ||
+ | |- | ||
+ | ! '''Interrface''' | ||
+ | | USB interface to check (Optional) | ||
+ | |- | ||
+ | ! '''DataInterface''' | ||
+ | | Return value for the located data interface | ||
+ | |- | ||
+ | ! '''ControlInterface''' | ||
+ | | Return value for the located control interface | ||
+ | |- | ||
+ | ! '''Quirks''' | ||
+ | | Any known quirks for this device from identification (eg CDCACM_QUIRK_NO_UNION_NORMAL) | ||
+ | |- | ||
+ | ! '''Capabilities''' | ||
+ | | Return value for ACM capabilities (eg USB_CDC_ACM_CAP_LINE) | ||
+ | |- | ||
+ | ! '''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 CDCACMControlRequest(Serial:PCDCACMDevice; Request:Byte; Value:Word; Data:Pointer;Size:Word):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 /> | ||
+ | <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 CDCACMGetLineRequest(Serial:PCDCACMDevice; var LineCoding:TUSBCDCLineCoding):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 /> | ||
+ | <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 CDCACMSetLineRequest(Serial:PCDCACMDevice; const LineCoding:TUSBCDCLineCoding):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 /> | ||
+ | <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 CDCACMSetControlRequest(Serial:PCDCACMDevice; Control:Word):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 | ||
|- | |- | ||
|} | |} |
Revision as of 01:47, 14 October 2016
Return to Unit Reference
Contents
[hide]Description
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
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
CDC ACM serial functions
function CDCACMSerialDeviceOpen(Serial:PSerialDevice; BaudRate,DataBits,StopBits,Parity,FlowControl,ReceiveDepth,TransmitDepth:LongWord):LongWord;
function CDCACMSerialDeviceClose(Serial:PSerialDevice):LongWord;
function CDCACMSerialDeviceRead(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
function CDCACMSerialDeviceWrite(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
CDC ACM USB functions
function CDCACMDriverBind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
function CDCACMDriverUnbind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
procedure CDCACMReceiveWorker(Request:PUSBRequest);
procedure CDCACMReceiveComplete(Request:PUSBRequest);
procedure CDCACMTransmitStart(Request:PUSBRequest);
procedure CDCACMTransmitWorker(Request:PUSBRequest);
procedure CDCACMTransmitComplete(Request:PUSBRequest);
procedure CDCACMInterruptWorker(Request:PUSBRequest);
procedure CDCACMInterruptComplete(Request:PUSBRequest);
CDC ACM helper functions
function CDCACMCheckDevice(Device:PUSBDevice; var Quirks:LongWord):LongWord;
function CDCACMCheckInterface(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
function CDCACMCheckDeviceAndInterface(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
function CDCACMFindInterfaces(Device:PUSBDevice; Interrface:PUSBInterface; var DataInterface,ControlInterface:PUSBInterface; Quirks:LongWord; var Capabilities:Byte):LongWord;
function CDCACMControlRequest(Serial:PCDCACMDevice; Request:Byte; Value:Word; Data:Pointer;Size:Word):LongWord;
function CDCACMGetLineRequest(Serial:PCDCACMDevice; var LineCoding:TUSBCDCLineCoding):LongWord;
function CDCACMSetLineRequest(Serial:PCDCACMDevice; const LineCoding:TUSBCDCLineCoding):LongWord;
function CDCACMSetControlRequest(Serial:PCDCACMDevice; Control:Word):LongWord;
Return to Unit Reference