Difference between revisions of "Unit UART"

From Ultibo.org
Jump to: navigation, search
Line 57: Line 57:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 69: Line 69:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 81: Line 81:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 93: Line 93:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 105: Line 105:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 117: Line 117:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 156: Line 156:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 168: Line 168:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 180: Line 180:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 192: Line 192:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 204: Line 204:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 216: Line 216:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 228: Line 228:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 240: Line 240:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 255: Line 255:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 267: Line 267:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 279: Line 279:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 291: Line 291:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 303: Line 303:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 315: Line 315:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 330: Line 330:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 342: Line 342:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 354: Line 354:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 366: Line 366:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 378: Line 378:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 390: Line 390:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 402: Line 402:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 414: Line 414:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 429: Line 429:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 441: Line 441:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}

Revision as of 05:54, 27 September 2016

Return to Unit Reference


Description


UART (Universal Asynchronous Receiver Transmitter) devices represent the industry standard serial communications devices that are available on almost every system.

This unit implements the framework for UART devices and provides a standardized API to allow driver specific implementation to be abstracted. All UART devices are also represented as a serial device and this unit handles the relationship between the two devices.

Each UART 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 and writes to UART devices are unbuffered and simply pass raw data to and from the caller unless the serial interface is used instead which includes buffering of transmitted and received data. 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.

Constants


To be documented

Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

procedure UARTInit;
Description: Initialize the UART unit and UART device table
Note Called only during system startup


UART functions

function UARTDeviceOpen(UART:PUARTDevice; BaudRate,DataBits,StopBits,Parity,FlowControl:LongWord):LongWord;
Description: To be documented
Note None documented


function UARTDeviceClose(UART:PUARTDevice):LongWord;
Description: To be documented
Note None documented


function UARTDeviceRead(UART:PUARTDevice; Buffer:Pointer; Size,Flags:LongWord;var Count:LongWord):LongWord;
Description: To be documented
Note None documented


function UARTDeviceWrite(UART:PUARTDevice; Buffer:Pointer; Size,Flags:LongWord;var Count:LongWord):LongWord;
Description: To be documented
Note None documented


function UARTDeviceStatus(UART:PUARTDevice):LongWord;
Description: To be documented
Note None documented


function UARTDeviceProperties(UART:PUARTDevice; Properties:PUARTProperties):LongWord;
Description: To be documented
Note None documented


function UARTDeviceCreate:PUARTDevice;
Description: Create a new UART entry
Return Pointer to new UART entry or nil if UART could not be created


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


function UARTDeviceDestroy(UART:PUARTDevice):LongWord;
Description: Destroy an existing UART entry
Note None documented


function UARTDeviceRegister(UART:PUARTDevice):LongWord;
Description: Register a new UART in the UART table
Note None documented


function UARTDeviceDeregister(UART:PUARTDevice):LongWord;
Description: Deregister a UART from the UART table
Note None documented


function UARTDeviceFind(UARTId:LongWord):PUARTDevice;
Description: To be documented
Note None documented


function UARTDeviceFindByName(const Name:String):PUARTDevice; inline;
Description: To be documented
Note None documented


function UARTDeviceFindByDescription(const Description:String):PUARTDevice; inline;
Description: To be documented
Note None documented


function UARTDeviceEnumerate(Callback:TUARTEnumerate; Data:Pointer):LongWord;
Description: To be documented
Note None documented


function UARTDeviceNotification(UART:PUARTDevice; Callback:TUARTNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
Note None documented


UART serial functions

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


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


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


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


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


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


UART helper functions

function UARTGetCount:LongWord; inline;
Description: Get the current UART count
Note None documented


function UARTDeviceGetDefault:PUARTDevice; inline;
Description: Get the current default UART device
Note None documented


function UARTDeviceSetDefault(UART:PUARTDevice):LongWord;
Description: Set the current default UART device
Note None documented


function UARTDeviceCheck(UART:PUARTDevice):PUARTDevice;
Description: Check if the supplied UART is in the UART table
Note None documented


procedure UARTLog(Level:LongWord;UART:PUARTDevice; const AText:String);
Description: To be documented
Note None documented


procedure UARTLogInfo(UART:PUARTDevice; const AText:String); inline;
Description: To be documented
Note None documented


procedure UARTLogError(UART:PUARTDevice; const AText:String); inline;
Description: To be documented
Note None documented


procedure UARTLogDebug(UART:PUARTDevice; const AText:String); inline;
Description: To be documented
Note None documented


UART serial helper functions

function UARTSerialDeviceReceive(UART:PUARTDevice):LongWord;
Description: To be documented
Note None documented


function UARTSerialDeviceTransmit(UART:PUARTDevice):LongWord;
Description: To be documented
Note None documented


Return to Unit Reference