Difference between revisions of "Unit Serial"

From Ultibo.org
Jump to: navigation, search
Line 154: Line 154:
 
<pre style="border: 0; padding-bottom:0px;">function SerialDeviceDestroy(Serial:PSerialDevice):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function SerialDeviceDestroy(Serial:PSerialDevice):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy an existing Serial entry</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy an existing Serial entry</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| To be 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 SerialDeviceRegister(Serial:PSerialDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Register a new Serial in the Serial table</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 04:21, 2 September 2016

Return to Unit Reference


Description


Serial devices represent a communication device that can be both read and written and has a set of common properties and capabilities. The underlying device may be an actual UART or it may be some other form of device such as a USB to Serial converter. As long as the device can implement the common capabilities then it can be accessed as a serial device without regard to the actual implementation.

Each serial device returns a set of properties that describe the capabilities of the device and includes a set of flags that indicate what features are supported.

Reads from and writes to serial devices are buffered so that varying data transfer rates can be accomodated and both reads and writes allow for non blocking so that a caller can avoid waiting for received data to be available or the device to be ready to transmit.

This unit also implements the serial logging device which can be configured via parameters in the GlobalConfig unit or from the command line.

Constants


To be documented

Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

procedure SerialInit;
Description: Initialize the Serial unit and Serial device table
Note To be documented


Serial functions

function SerialDeviceOpen(Serial:PSerialDevice; BaudRate,DataBits,StopBits,Parity,FlowControl,ReceiveDepth,TransmitDepth:LongWord):LongWord;
Description: To be documented
Note To be documented


function SerialDeviceClose(Serial:PSerialDevice):LongWord;
Description: To be documented
Note To be documented


function SerialDeviceRead(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
Description: To be documented
Note To be documented


function SerialDeviceWrite(Serial:PSerialDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
Description: To be documented
Note To be documented


function SerialDeviceStatus(Serial:PSerialDevice):LongWord;
Description: To be documented
Note To be documented


function SerialDeviceProperties(Serial:PSerialDevice; Properties:PSerialProperties):LongWord;
Description: To be documented
Note To be documented


function SerialDeviceCreate:PSerialDevice;
Description: Create a new Serial entry
Return Pointer to new Serial entry or nil if Serial could not be created


function SerialDeviceCreateEx(Size:LongWord):PSerialDevice;
Description: Create a new Serial entry
Size Size in bytes to allocate for new Serial (Including the Serial entry)
Return Pointer to new Serial entry or nil if Serial could not be created


function SerialDeviceDestroy(Serial:PSerialDevice):LongWord;
Description: Destroy an existing Serial entry
Note To be documented


function SerialDeviceRegister(Serial:PSerialDevice):LongWord;
Description: Register a new Serial in the Serial table
Note To be documented


Return to Unit Reference