Unit UART

From Ultibo.org
Revision as of 03:45, 9 September 2016 by Ultibo (Talk | contribs)

Jump to: navigation, search

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 To be documented


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


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


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


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


function UARTDeviceProperties(UART:PUARTDevice; Properties:PUARTProperties):LongWord;
Description: To be documented
Note To be 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 To be documented


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


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


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


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


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


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


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


Return to Unit Reference