Difference between revisions of "Unit USBCDCACM"
Line 651: | Line 651: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 CDCACMSerialDeviceOpen(Serial:PSerialDevice; BaudRate,DataBits,StopBits,Parity,FlowControl,ReceiveDepth,TransmitDepth:LongWord):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function CDCACMSerialDeviceOpen(Serial:PSerialDevice; BaudRate,DataBits,StopBits,Parity,FlowControl,ReceiveDepth,TransmitDepth:LongWord):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SerialDeviceOpen API for CDCACM Serial</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
! Note | ! Note | ||
− | | | + | | Not intended to be called directly by applications, use SerialDeviceOpen instead. |
|- | |- | ||
|} | |} | ||
Line 663: | Line 663: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 CDCACMSerialDeviceClose(Serial:PSerialDevice):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function CDCACMSerialDeviceClose(Serial:PSerialDevice):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SerialDeviceClose API for CDCACM Serial</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
! Note | ! Note | ||
− | | | + | | Not intended to be called directly by applications, use SerialDeviceClose instead. |
|- | |- | ||
|} | |} | ||
Line 675: | Line 675: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 CDCACMSerialDeviceRead(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function CDCACMSerialDeviceRead(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SerialDeviceRead API for CDCACM Serial</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
! Note | ! Note | ||
− | | | + | | Not intended to be called directly by applications, use SerialDeviceRead instead. |
|- | |- | ||
|} | |} | ||
Line 687: | Line 687: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 CDCACMSerialDeviceWrite(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function CDCACMSerialDeviceWrite(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of SerialDeviceWrite API for CDCACM Serial</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
! Note | ! Note | ||
− | | | + | | Not intended to be called directly by applications, use SerialDeviceWrite instead. |
|- | |- | ||
|} | |} | ||
Line 736: | Line 736: | ||
</div></div> | </div></div> | ||
<br /> | <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 CDCACMReceiveStart(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;"> | <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 CDCACMReceiveWorker(Request:PUSBRequest);</pre> | <pre style="border: 0; padding-bottom:0px;">procedure CDCACMReceiveWorker(Request:PUSBRequest);</pre> |
Latest revision as of 03:53, 10 May 2019
Return to Unit Reference
Contents
[hide]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
CDCACM_*
CDCACM_USB_REQUEST_*
CDCACM_QUIRK_*
CDCACM_DEVICE_ID_*
CDCACM_INTERFACE_ID_*
CDCACM_DEVICE_INTERFACE_ID_*
Type definitions
CDC ACM device Id
CDC ACM device
Public variables
None defined
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 CDCACMReceiveStart(Request:PUSBRequest);
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