Difference between revisions of "Unit FTDISerial"
Line 118: | Line 118: | ||
<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 FTDISerialDriverUnbind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function FTDISerialDriverUnbind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unbind the FTDI Serial driver | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unbind the FTDI Serial driver from a USB device</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;" | ||
|- | |- | ||
! '''Device''' | ! '''Device''' | ||
− | | The USB device to unbind | + | | The USB device to unbind from |
|- | |- | ||
! '''Interrface''' | ! '''Interrface''' | ||
− | | The USB interface to unbind | + | | The USB interface to unbind from (or nil for whole device) |
|- | |- | ||
! '''Return''' | ! '''Return''' | ||
Line 136: | Line 136: | ||
<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 FTDISerialReceiveWorker(Request:PUSBRequest);</pre> | <pre style="border: 0; padding-bottom:0px;">procedure FTDISerialReceiveWorker(Request:PUSBRequest);</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called (by a Worker thread) to process a completed USB request | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called (by a Worker thread) to process a completed USB request from the FTDI Serial bulk IN endpoint</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;" | ||
Line 169: | Line 169: | ||
<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 FTDISerialReceiveComplete(Request:PUSBRequest);</pre> | <pre style="border: 0; padding-bottom:0px;">procedure FTDISerialReceiveComplete(Request:PUSBRequest);</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called when a USB request | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called when a USB request from the FTDI Serial bulk IN endpoint completes</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;" | ||
Line 184: | Line 184: | ||
<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 FTDISerialTransmitStart(Request:PUSBRequest);</pre> | <pre style="border: 0; padding-bottom:0px;">procedure FTDISerialTransmitStart(Request:PUSBRequest);</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called to continue transmission of data | + | <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;"> | <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;" |
Revision as of 03:34, 1 December 2016
Return to Unit Reference
Contents
[hide]Description
This driver is intended to support a range of USB to Serial converter chips manufactured by Future Technology Devices International Ltd (FTDI). These include devices using the FT232H,FT-X (FT201X, FT230X, FT231X), FT8U100AX and FT4232H as well as others, many of these chips utilize similar communications protocols and where different the driver attempts to account for those differences.
The driver also supports communication with many Arduino models that contain an FTDI serial device on board rather than the USB CDC ADM device found in more recent models.
Any device recognized as an FTDI Serial is presented 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 within application code.
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
FTDI serial functions
function FTDISerialDeviceOpen(Serial:PSerialDevice; BaudRate,DataBits,StopBits,Parity,FlowControl,ReceiveDepth,TransmitDepth:LongWord):LongWord;
function FTDISerialDeviceClose(Serial:PSerialDevice):LongWord;
function FTDISerialDeviceRead(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
function FTDISerialDeviceWrite(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
FTDI serial USB functions
function FTDISerialDriverBind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
function FTDISerialDriverUnbind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
procedure FTDISerialReceiveWorker(Request:PUSBRequest);
procedure FTDISerialReceiveComplete(Request:PUSBRequest);
procedure FTDISerialTransmitStart(Request:PUSBRequest);
procedure FTDISerialTransmitWorker(Request:PUSBRequest);
procedure FTDISerialTransmitComplete(Request:PUSBRequest);
FTDI serial helper functions
function FTDISerialCheckDevice(Device:PUSBDevice):LongWord;
function FTDISerialCheckDeviceAndInterface(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
function FTDISerialPatchDevice(Device:PUSBDevice; var Quirks:LongWord):LongWord;
function FTDISerialCheckJTAGDevice(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
function FTDISerialCheck8U2232CDevice(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
function FTDISerialCheckSTMCLiteDevice(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
function FTDISerialDetermineType(Serial:PFTDISerialDevice):LongWord;
function FTDISerialGetLatency(Serial:PFTDISerialDevice):LongWord;
function FTDISerialSetLatency(Serial:PFTDISerialDevice):LongWord;
function FTDISerialReset(Serial:PFTDISerialDevice; Value:Word):LongWord;
function FTDISerialSetData(Serial:PFTDISerialDevice; Value:Word):LongWord;
function FTDISerialSetBaudRate(Serial:PFTDISerialDevice; Divisor:LongWord):LongWord;
function FTDISerialSetFlowControl(Serial:PFTDISerialDevice; Index:Word):LongWord;
function FTDISerialGetModemStatus(Serial:PFTDISerialDevice; var Status:Word):LongWord;
function FTDISerialSetModemControl(Serial:PFTDISerialDevice; Value:Word):LongWord;
function FTDISerialGetDivisor(Serial:PFTDISerialDevice; var BaudRate:LongWord):LongWord;
function FTDISerialBaudToDivisor232AM(Serial:PFTDISerialDevice; BaudRate:LongWord):LongWord;
function FTDISerialBaudToDivisor232BM(Serial:PFTDISerialDevice; BaudRate:LongWord):LongWord;
function FTDISerialBaudToDivisor2232H(Serial:PFTDISerialDevice; BaudRate:LongWord):LongWord;
Return to Unit Reference