Unit Devices

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


Ultibo Device Interface unit

Constants



[Expand]
Device specific constants DEVICE_*


[Expand]
Device signature DEVICE_SIGNATURE_*


[Expand]
Device name DEVICE_*_LENGTH


[Expand]
Device bus DEVICE_BUS_*


[Expand]
Device state DEVICE_STATE_*


[Expand]
Device Id DEVICE_ID_*


[Expand]
Device class DEVICE_CLASS_*


[Expand]
Device notification flag DEVICE_NOTIFICATION_*


[Expand]
Firmware name FIRMWARE_NAME_*


[Expand]
Firmware actions FIRMWARE_ACTION_*


[Expand]
Firmware constants FIRMWARE_*


[Expand]
Notifier signature NOTIFIER_SIGNATURE_*


[Expand]
Notifier state NOTIFIER_STATE_*


[Expand]
Notifier flag NOTIFIER_FLAG_*


[Expand]
Device logging DEVICE_LOG_*


[Expand]
Driver specific constants DRIVER_*


[Expand]
Driver signature DRIVER_SIGNATURE_*


[Expand]
Driver name DRIVER_NAME_*


[Expand]
Driver state DRIVER_STATE_*


[Expand]
Driver Id DRIVER_ID_*


[Expand]
Driver class DRIVER_CLASS_*


[Expand]
Host specific constants HOST_*


[Expand]
Host signature HOST_SIGNATURE_*


[Expand]
Host name HOST_NAME_*


[Expand]
Host state HOST_STATE_*


[Expand]
Host Id HOST_ID_*


[Expand]
Host class HOST_CLASS_*


[Expand]
Clock specific constants CLOCK_*


[Expand]
Clock device type CLOCK_TYPE_*


[Expand]
Clock device state CLOCK_STATE_*


[Expand]
Clock device flag CLOCK_FLAG_*


[Expand]
Timer specific constants TIMER_*


[Expand]
Timer device type TIMER_TYPE_*


[Expand]
Timer device state TIMER_STATE_*


[Expand]
Timer device flag TIMER_FLAG_*


[Expand]
Timer event flag TIMER_EVENT_FLAG_*


[Expand]
Random specific constants RANDOM_*


[Expand]
Random device type RANDOM_TYPE_*


[Expand]
Random device state RANDOM_STATE_*


[Expand]
Random device flag RANDOM_FLAG_*


[Expand]
Mailbox specific constants MAILBOX_*


[Expand]
Mailbox device type MAILBOX_TYPE_*


[Expand]
Mailbox device state MAILBOX_STATE_*


[Expand]
Mailbox device flag MAILBOX_FLAG_*


[Expand]
Watchdog specific constants WATCHDOG_*


[Expand]
Watchdog device type WATCHDOG_TYPE_*


[Expand]
Watchdog device state WATCHDOG_STATE_*


[Expand]
Watchdog device flag WATCHDOG_FLAG_*


Type definitions



Device enumeration callback

TDeviceEnumerate = function(Device:PDevice; Data:Pointer):LongWord;

Device notification callback

TDeviceNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

Device entry

[Expand]

PDevice = ^TDevice;

TDevice = record

Device firmware

[Expand]

PDeviceFirmware = ^TDeviceFirmware;

TDeviceFirmware = record

Device firmware handler

TDeviceFirmwareHandler = function(Firmware:PDeviceFirmware; Action:LongWord; var Handle:THandle; var Buffer:Pointer; var Value:LongWord):LongWord;

Firmware handle

[Expand]

PFirmwareHandle = ^TFirmwareHandle;

TFirmwareHandle = record

Notifier entry

[Expand]

PNotifier = ^TNotifier;

TNotifier = record

Notifier task

[Expand]

PNotifierTask = ^TNotifierTask;

TNotifierTask = record

Notifier retry

[Expand]

PNotifierRetry = ^TNotifierRetry;

TNotifierRetry = record

Driver enumeration callback

TDriverEnumerate = function(Driver:PDriver; Data:Pointer):LongWord;

Driver entry

[Expand]

PDriver = ^TDriver;

TDriver = record

Host enumeration callback

THostEnumerate = function(Host:PHost; Data:Pointer):LongWord;

Host entry

[Expand]

PHost = ^THost;

THost = record

Clock properties

[Expand]

PClockProperties = ^TClockProperties;

TClockProperties = record

Clock enumeration callback

TClockEnumerate = function(Clock:PClockDevice; Data:Pointer):LongWord;

Clock notification callback

TClockNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

Clock device start

TClockDeviceStart = function(Clock:PClockDevice):LongWord;

Clock device stop

TClockDeviceStop = function(Clock:PClockDevice):LongWord;

Clock device read

TClockDeviceRead = function(Clock:PClockDevice):LongWord;

Clock device read 64

TClockDeviceRead64 = function(Clock:PClockDevice):Int64;

Clock device write 64

TClockDeviceWrite64 = function(Clock:PClockDevice; const Value:Int64):LongWord;

Clock device get rate

TClockDeviceGetRate = function(Clock:PClockDevice):LongWord;

Clock device set rate

TClockDeviceSetRate = function(Clock:PClockDevice; Rate:LongWord):LongWord;

Clock device get properties

TClockDeviceGetProperties = function(Clock:PClockDevice; Properties:PClockProperties):LongWord;

Clock device

[Expand]

PClockDevice = ^TClockDevice;

TClockDevice = record

Timer callback

TTimerCallback = TCounterCallback; Counter callback from Platform

Timer properties

[Expand]

PTimerProperties = ^TTimerProperties;

TTimerProperties = record

Timer waiter

[Expand]

PTimerWaiter = ^TTimerWaiter;

TTimerWaiter = record

Timer enumeration callback

TTimerEnumerate = function(Timer:PTimerDevice; Data:Pointer):LongWord;

Timer notification callback

TTimerNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

TImer device start

TTimerDeviceStart = function(Timer:PTimerDevice):LongWord;

Timer device stop

TTimerDeviceStop = function(Timer:PTimerDevice):LongWord;

Timer device read

TTimerDeviceRead = function(Timer:PTimerDevice):LongWord;

Timer device read 64

TTimerDeviceRead64 = function(Timer:PTimerDevice):Int64;

Timer device wait

TTimerDeviceWait = function(Timer:PTimerDevice):LongWord;

Timer device event

TTimerDeviceEvent = function(Timer:PTimerDevice; Flags:LongWord; Callback:TTimerCallback; Data:Pointer):LongWord;

Timer device cancel

TTimerDeviceCancel = function(Timer:PTimerDevice):LongWord;

Timer device get rate

TTimerDeviceGetRate = function(Timer:PTimerDevice):LongWord;

Timer device set rate

TTimerDeviceSetRate = function(Timer:PTimerDevice; Rate:LongWord):LongWord;

Timer device get interval

TTimerDeviceGetInterval = function(Timer:PTimerDevice):LongWord;

Timer device set interval

TTimerDeviceSetInterval = function(Timer:PTimerDevice; Interval:LongWord):LongWord;

Timer device get properties

TTimerDeviceGetProperties = function(Timer:PTimerDevice; Properties:PTimerProperties):LongWord;

Timer device

[Expand]

PTimerDevice = ^TTimerDevice;

TTimerDevice = record

Random enumeration callback

TRandomEnumerate = function(Random:PRandomDevice; Data:Pointer):LongWord;

Random notification callback

TRandomNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

Random device start

TRandomDeviceStart = function(Random:PRandomDevice):LongWord;

Random device stop

TRandomDeviceStop = function(Random:PRandomDevice):LongWord;

Random device seed

TRandomDeviceSeed = function(Random:PRandomDevice; Seed:LongWord):LongWord;

Random device read byte

TRandomDeviceReadByte = function(Random:PRandomDevice):Byte;

Random device read word

TRandomDeviceReadWord = function(Random:PRandomDevice):Word;

Random device read long word

TRandomDeviceReadLongWord = function(Random:PRandomDevice):LongWord;

Random device read quad word

TRandomDeviceReadQuadWord = function(Random:PRandomDevice):Int64;

Random device read double

TRandomDeviceReadDouble = function(Random:PRandomDevice):Double;

Random device

[Expand]

PRandomDevice = ^TRandomDevice;

TRandomDevice = record

Mailbox enumeration callback

TMailboxEnumerate = function(Mailbox:PMailboxDevice; Data:Pointer):LongWord;

Mailbox notification callback

TMailboxNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

Mailbox device start

TMailboxDeviceStart = function(Mailbox:PMailboxDevice):LongWord;

Mailbox device stop

TMailboxDeviceStop = function(Mailbox:PMailboxDevice):LongWord;

Mailbox device receive

TMailboxDeviceReceive = function(Mailbox:PMailboxDevice; Channel:LongWord):LongWord;

Mailbox device send

TMailboxDeviceSend = function(Mailbox:PMailboxDevice; Channel,Data:LongWord):LongWord;

Mailbox device call

TMailboxDeviceCall = function(Mailbox:PMailboxDevice; Channel,Data:LongWord; var Response:LongWord):LongWord;

Mailbox device get timeout

TMailboxDeviceGetTimeout = function(Mailbox:PMailboxDevice):LongWord;

Mailbox device set timeout

TMailboxDeviceSetTimeout = function(Mailbox:PMailboxDevice; Timeout:LongWord):LongWord;

Mailbox device

[Expand]

PMailboxDevice = ^TMailboxDevice;

TMailboxDevice = record

Watchdog enumeration callback

TWatchdogEnumerate = function(Watchdog:PWatchdogDevice; Data:Pointer):LongWord;

Watchdog notification callback

TWatchdogNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

Watchdog device start

TWatchdogDeviceStart = function(Watchdog:PWatchdogDevice):LongWord;

Watchdog device stop

TWatchdogDeviceStop = function(Watchdog:PWatchdogDevice):LongWord;

Watchdog device refresh

TWatchdogDeviceRefresh = function(Watchdog:PWatchdogDevice):LongWord;

Watchdog device get remain

TWatchdogDeviceGetRemain = function(Watchdog:PWatchdogDevice):LongWord;

Watchdog device get timeout

TWatchdogDeviceGetTimeout = function(Watchdog:PWatchdogDevice):LongWord;

Watchdog device set timeout

TWatchdogDeviceSetTimeout = function(Watchdog:PWatchdogDevice; Timeout:LongWord):LongWord;

Watchdog device

[Expand]

PWatchdogDevice = ^TWatchdogDevice;

TWatchdogDevice = record


Public variables



Device logging

DEVICE_DEFAULT_LOG_LEVEL:LongWord = DEVICE_LOG_LEVEL_DEBUG; Minimum level for Device messages. Only messages with level greater than or equal to this will be printed.
DEVICE_LOG_ENABLED:Boolean;


Function declarations



Initialization functions

[Expand]
procedure DevicesInit;
Description: Initialize the Devices unit and device, notifier and driver tables


Device functions

[Expand]
function DeviceCreate:PDevice;
Description: Create a new Device entry


[Expand]
function DeviceCreateEx(Size:LongWord):PDevice;
Description: Create a new Device entry


[Expand]
function DeviceDestroy(Device:PDevice):LongWord;
Description: Destroy an existing Device entry


[Expand]
function DeviceGetName(Device:PDevice):String;
Description: Get the name of the supplied Device


[Expand]
function DeviceSetName(Device:PDevice; const Name:String):LongWord;
Description: Set the name of the supplied Device


[Expand]
function DeviceGetDescription(Device:PDevice):String;
Description: Get the description of the supplied Device


[Expand]
function DeviceSetDescription(Device:PDevice; const Description:String):LongWord;
Description: Set the description of the supplied Device


[Expand]
function DeviceRegister(Device:PDevice):LongWord;
Description: Register a new Device in the Device table


[Expand]
function DeviceDeregister(Device:PDevice):LongWord;
Description: Deregister a Device from the Device table


[Expand]
function DeviceFind(DeviceClass,DeviceId:LongWord):PDevice;
Description: Find a device by ID in the device table


[Expand]
function DeviceFindByDeviceData(DeviceData:Pointer):PDevice;
Description: Find a device with matching DeviceData property in the device table


[Expand]
function DeviceFindByName(const Name:String):PDevice; inline;
Description: Find a device by name in the device table


[Expand]
function DeviceFindByNameEx(DeviceClass:LongWord; const Name:String):PDevice;
Description: Find a device by class and name in the device table


[Expand]
function DeviceFindByDescription(const Description:String):PDevice; inline;
Description: Find a device by description in the device table


[Expand]
function DeviceFindByDescriptionEx(DeviceClass:LongWord; const Description:String):PDevice;
Description: Find a device by class and description in the device table


[Expand]
function DeviceEnumerate(DeviceClass:LongWord; Callback:TDeviceEnumerate; Data:Pointer):LongWord;
Description: Enumerate all devices in the device table


[Expand]
function DeviceNotification(Device:PDevice; DeviceClass:LongWord; Callback:TDeviceNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: Register a notification for device changes


[Expand]
function DeviceFirmwareCreate(DeviceClass:LongWord; const Name:String; Buffer:Pointer; Size:LongWord):Boolean;
Description: Create a new block (memory) based firmware entry using the standard block firmware handler


[Expand]
function DeviceFirmwareRegister(DeviceClass:LongWord; const Name:String; Handler:TDeviceFirmwareHandler):THandle;
Description: Register a new device firmware handler for acquiring device specific firmware


[Expand]
function DeviceFirmwareDeregister(Handle:THandle):LongWord;
Description: Deregister an existing device firmware handler


[Expand]
function DeviceFirmwareFind(DeviceClass:LongWord; const Name:String):PDeviceFirmware;
Description: Find an existing device firmware handler for a specified device


[Expand]
function DeviceFirmwareFindByHandle(Handle:THandle):PDeviceFirmware;
Description: Find an existing device firmware handler from a returned handle


[Expand]
function DeviceFirmwareOpen(DeviceClass:LongWord; const Name:String; Timeout:LongWord; var Handle:THandle):LongWord;
Description: Open the firmware for a specified device from a registered handler


[Expand]
function DeviceFirmwareClose(Handle:THandle):LongWord;
Description: Close a handle to the firmware for a specified device from a registered handler


[Expand]
function DeviceFirmwareSize(Handle:THandle):LongInt;
Description: Return the size of the firmware for a specified device from a registered handler


[Expand]
function DeviceFirmwareSeek(Handle:THandle; Position:LongInt):LongInt;
Description: Seek to a position within the firmware for a specified device from a registered handler


[Expand]
function DeviceFirmwareRead(Handle:THandle; Buffer:Pointer; Count:LongInt):LongInt;
Description: Read into a buffer from the firmware for a specified device from a registered handler


[Expand]
function DeviceFirmwareAcquire(DeviceClass:LongWord; const Name:String; Timeout:LongWord; var Handle:THandle; var Buffer:Pointer; var Size:LongWord):LongWord;
Description: Acquire a memory block containing the firmware for a specified device from a registered handler


[Expand]
function DeviceFirmwareRelease(Handle:THandle; Buffer:Pointer; Size:LongWord):LongWord;
Description: Release a memory block containing the firmware for a specified device from a registered handler


[Expand]
function NotifierAllocate(Device:PDevice; DeviceClass:LongWord; Callback:TDeviceNotification; Data:Pointer; Notification,Flags:LongWord):PNotifier;
Description: Create and Register a new Notifier entry in the Notifier table


[Expand]
function NotifierRelease(Notifier:PNotifier):LongWord;
Description: Deregister and Destroy a Notifier from the Notifier table


[Expand]
function NotifierFind(Device:PDevice; DeviceClass:LongWord; Callback:TDeviceNotification; Data:Pointer):PNotifier;
Description: To be documented


[Expand]
function NotifierNotify(Device:PDevice; Notification:LongWord):LongWord;
Description: To be documented


[Expand]
procedure NotifierRetry(Retry:PNotifierRetry);
Description: To be documented


[Expand]
procedure NotifierWorker(Task:PNotifierTask);
Description: To be documented


Driver functions

[Expand]
function DriverCreate:PDriver;
Description: Create a new Driver entry


[Expand]
function DriverCreateEx(Size:LongWord):PDriver;
Description: Create a new Driver entry


[Expand]
function DriverDestroy(Driver:PDriver):LongWord;
Description: Destroy an existing Driver entry


[Expand]
function DriverGetName(Driver:PDriver):String;
Description: Get the name of the supplied Driver


[Expand]
function DriverSetName(Driver:PDriver; const Name:String):LongWord;
Description: Set the name of the supplied Driver


[Expand]
function DriverRegister(Driver:PDriver):LongWord;
Description: Register a new Driver in the Driver table


[Expand]
function DriverDeregister(Driver:PDriver):LongWord;
Description: Deregister a Driver from the Driver table


[Expand]
function DriverFind(DriverClass,DriverId:LongWord):PDriver;
Description: Find a driver by ID in the driver table


[Expand]
function DriverFindByName(const Name:String):PDriver;
Description: Find a driver by name in the driver table


[Expand]
function DriverEnumerate(DriverClass:LongWord; Callback:TDriverEnumerate; Data:Pointer):LongWord;
Description: Enumerate all drivers in the driver table


Clock device functions

[Expand]
function ClockDeviceStart(Clock:PClockDevice):LongWord;
Description: Start the counter of the specified clock device


[Expand]
function ClockDeviceStop(Clock:PClockDevice):LongWord;
Description: Stop the counter of the specified clock device


[Expand]
function ClockDeviceRead(Clock:PClockDevice):LongWord;
Description: Read the counter value of the specified clock device


[Expand]
function ClockDeviceRead64(Clock:PClockDevice):Int64;
Description: Read the counter value of the specified clock device


[Expand]
function ClockDeviceWrite64(Clock:PClockDevice; const Value:Int64):LongWord;
Description: Write the counter value of the specified clock device


[Expand]
function ClockDeviceGetRate(Clock:PClockDevice):LongWord;
Description: Get the current clock rate in Hz of the specified clock device


[Expand]
function ClockDeviceSetRate(Clock:PClockDevice; Rate:LongWord):LongWord;
Description: Set the current clock rate in Hz of the specified clock device


[Expand]
function ClockDeviceProperties(Clock:PClockDevice; Properties:PClockProperties):LongWord; inline;
Description: Get the properties for the specified clock device


[Expand]
function ClockDeviceGetProperties(Clock:PClockDevice; Properties:PClockProperties):LongWord;
Description: Get the properties for the specified clock device


[Expand]
function ClockDeviceCreate:PClockDevice;
Description: Create a new Clock entry


[Expand]
function ClockDeviceCreateEx(Size:LongWord):PClockDevice;
Description: Create a new Clock entry


[Expand]
function ClockDeviceDestroy(Clock:PClockDevice):LongWord;
Description: Destroy an existing clock entry


[Expand]
function ClockDeviceRegister(Clock:PClockDevice):LongWord;
Description: Register a new clock in the clock table


[Expand]
function ClockDeviceDeregister(Clock:PClockDevice):LongWord;
Description: Deregister a clock from the clock table


[Expand]
function ClockDeviceFind(ClockId:LongWord):PClockDevice;
Description: Find a clock device by ID in the clock table


[Expand]
function ClockDeviceFindByName(const Name:String):PClockDevice; inline;
Description: Find a clock device by name in the clock table


[Expand]
function ClockDeviceFindByDescription(const Description:String):PClockDevice; inline;
Description: Find a clock device by description in the clock table


[Expand]
function ClockDeviceEnumerate(Callback:TClockEnumerate; Data:Pointer):LongWord;
Description: Enumerate all clock devices in the clock table


[Expand]
function ClockDeviceNotification(Clock:PClockDevice; Callback:TClockNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: Register a notification for clock device changes


Timer device functions

[Expand]
function TimerDeviceStart(Timer:PTimerDevice):LongWord;
Description: Start the clock and counter of the specified Timer device


[Expand]
function TimerDeviceStop(Timer:PTimerDevice):LongWord;
Description: Stop the clock and counter of the specified Timer device


[Expand]
function TimerDeviceRead(Timer:PTimerDevice):LongWord;
Description: Read the current value of the specified Timer device


[Expand]
function TimerDeviceRead64(Timer:PTimerDevice):Int64;
Description: Read the current value of the specified Timer device


[Expand]
function TimerDeviceWait(Timer:PTimerDevice):LongWord;
Description: Wait for the current interval to expire on the specified Timer device


[Expand]
function TimerDeviceEvent(Timer:PTimerDevice; Flags:LongWord; Callback:TTimerCallback; Data:Pointer):LongWord;
Description: Schedule a function to be called when the current interval expires on the specified Timer device


[Expand]
function TimerDeviceCancel(Timer:PTimerDevice):LongWord;
Description: Cancel a previously scheduled event callback function on the specified Timer device


[Expand]
function TimerDeviceGetRate(Timer:PTimerDevice):LongWord;
Description: Get the current clock rate in Hz of the specified Timer device


[Expand]
function TimerDeviceSetRate(Timer:PTimerDevice; Rate:LongWord):LongWord;
Description: Set the current clock rate in Hz of the specified Timer device


[Expand]
function TimerDeviceGetInterval(Timer:PTimerDevice):LongWord;
Description: Get the current interval in ticks of the specified Timer device


[Expand]
function TimerDeviceSetInterval(Timer:PTimerDevice; Interval:LongWord):LongWord;
Description: Set the current interval in ticks of the specified Timer device


[Expand]
function TimerDeviceProperties(Timer:PTimerDevice; Properties:PTimerProperties):LongWord; inline;
Description: Get the properties for the specified Timer device


[Expand]
function TimerDeviceGetProperties(Timer:PTimerDevice; Properties:PTimerProperties):LongWord;
Description: Get the properties for the specified Timer device


[Expand]
function TimerDeviceCreate:PTimerDevice;
Description: Create a new Timer entry


[Expand]
function TimerDeviceCreateEx(Size:LongWord):PTimerDevice;
Description: Create a new Timer entry


[Expand]
function TimerDeviceDestroy(Timer:PTimerDevice):LongWord;
Description: Destroy an existing Timer entry


[Expand]
function TimerDeviceRegister(Timer:PTimerDevice):LongWord;
Description: Register a new Timer in the Timer table


[Expand]
function TimerDeviceDeregister(Timer:PTimerDevice):LongWord;
Description: Deregister a Timer from the Timer table


[Expand]
function TimerDeviceFind(TimerId:LongWord):PTimerDevice;
Description: Find a timer device by ID in the timer table


[Expand]
function TimerDeviceFindByName(const Name:String):PTimerDevice; inline;
Description: Find a timer device by name in the timer table


[Expand]
function TimerDeviceFindByDescription(const Description:String):PTimerDevice; inline;
Description: Find a timer device by description in the timer table


[Expand]
function TimerDeviceEnumerate(Callback:TTimerEnumerate; Data:Pointer):LongWord;
Description: Enumerate all timer devices in the timer table


[Expand]
function TimerDeviceNotification(Timer:PTimerDevice; Callback:TTimerNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: Register a notification for timer device changes


Random device functions

[Expand]
function RandomDeviceStart(Random:PRandomDevice):LongWord;
Description: To be documented


[Expand]
function RandomDeviceStop(Random:PRandomDevice):LongWord;
Description: To be documented


[Expand]
function RandomDeviceSeed(Random:PRandomDevice; Seed:LongWord):LongWord;
Description: To be documented


[Expand]
function RandomDeviceReadByte(Random:PRandomDevice):Byte;
Description: To be documented


[Expand]
function RandomDeviceReadWord(Random:PRandomDevice):Word;
Description: To be documented


[Expand]
function RandomDeviceReadLongWord(Random:PRandomDevice):LongWord;
Description: To be documented


[Expand]
function RandomDeviceReadQuadWord(Random:PRandomDevice):Int64;
Description: To be documented


[Expand]
function RandomDeviceReadDouble(Random:PRandomDevice):Double;
Description: To be documented


[Expand]
function RandomDeviceReadExtended(Random:PRandomDevice):Extended; inline;
Description: To be documented


[Expand]
function RandomDeviceCreate:PRandomDevice;
Description: Create a new Random entry


[Expand]
function RandomDeviceCreateEx(Size:LongWord):PRandomDevice;
Description: Create a new Random entry


[Expand]
function RandomDeviceDestroy(Random:PRandomDevice):LongWord;
Description: Destroy an existing Random entry


[Expand]
function RandomDeviceRegister(Random:PRandomDevice):LongWord;
Description: Register a new Random in the Random table


[Expand]
function RandomDeviceDeregister(Random:PRandomDevice):LongWord;
Description: Deregister a Random from the Random table


[Expand]
function RandomDeviceFind(RandomId:LongWord):PRandomDevice;
Description: To be documented


[Expand]
function RandomDeviceFindByName(const Name:String):PRandomDevice; inline;
Description: To be documented


[Expand]
function RandomDeviceFindByDescription(const Description:String):PRandomDevice; inline;
Description: To be documented


[Expand]
function RandomDeviceEnumerate(Callback:TRandomEnumerate; Data:Pointer):LongWord;
Description: To be documented


[Expand]
function RandomDeviceNotification(Random:PRandomDevice; Callback:TRandomNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented


Mailbox device functions

[Expand]
function MailboxDeviceStart(Mailbox:PMailboxDevice):LongWord;
Description: To be documented


[Expand]
function MailboxDeviceStop(Mailbox:PMailboxDevice):LongWord;
Description: To be documented


[Expand]
function MailboxDeviceReceive(Mailbox:PMailboxDevice; Channel:LongWord):LongWord;
Description: To be documented


[Expand]
function MailboxDeviceSend(Mailbox:PMailboxDevice; Channel,Data:LongWord):LongWord;
Description: To be documented


[Expand]
function MailboxDeviceCall(Mailbox:PMailboxDevice; Channel,Data:LongWord; var Response:LongWord):LongWord;
Description: To be documented


[Expand]
function MailboxDeviceGetTimeout(Mailbox:PMailboxDevice):LongWord;
Description: To be documented


[Expand]
function MailboxDeviceSetTimeout(Mailbox:PMailboxDevice; Timeout:LongWord):LongWord;
Description: To be documented


[Expand]
function MailboxDeviceCreate:PMailboxDevice;
Description: Create a new Mailbox entry


[Expand]
function MailboxDeviceCreateEx(Size:LongWord):PMailboxDevice;
Description: Create a new Mailbox entry


[Expand]
function MailboxDeviceDestroy(Mailbox:PMailboxDevice):LongWord;
Description: Destroy an existing Mailbox entry


[Expand]
function MailboxDeviceRegister(Mailbox:PMailboxDevice):LongWord;
Description: Register a new Mailbox in the Mailbox table


[Expand]
function MailboxDeviceDeregister(Mailbox:PMailboxDevice):LongWord;
Description: Deregister a Mailbox from the Mailbox table


[Expand]
function MailboxDeviceFind(MailboxId:LongWord):PMailboxDevice;
Description: To be documented


[Expand]
function MailboxDeviceFindByName(const Name:String):PMailboxDevice; inline;
Description: To be documented


[Expand]
function MailboxDeviceFindByDescription(const Description:String):PMailboxDevice; inline;
Description: To be documented


[Expand]
function MailboxDeviceEnumerate(Callback:TMailboxEnumerate; Data:Pointer):LongWord;
Description: To be documented


[Expand]
function MailboxDeviceNotification(Mailbox:PMailboxDevice; Callback:TMailboxNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented


Watchdog device functions

[Expand]
function WatchdogDeviceStart(Watchdog:PWatchdogDevice):LongWord;
Description: To be documented


[Expand]
function WatchdogDeviceStop(Watchdog:PWatchdogDevice):LongWord;
Description: To be documented


[Expand]
function WatchdogDeviceRefresh(Watchdog:PWatchdogDevice):LongWord;
Description: To be documented


[Expand]
function WatchdogDeviceGetRemain(Watchdog:PWatchdogDevice):LongWord;
Description: To be documented


[Expand]
function WatchdogDeviceGetTimeout(Watchdog:PWatchdogDevice):LongWord;
Description: To be documented


[Expand]
function WatchdogDeviceSetTimeout(Watchdog:PWatchdogDevice; Timeout:LongWord):LongWord;
Description: To be documented


[Expand]
function WatchdogDeviceCreate:PWatchdogDevice;
Description: Create a new Watchdog entry


[Expand]
function WatchdogDeviceCreateEx(Size:LongWord):PWatchdogDevice;
Description: Create a new Watchdog entry


[Expand]
function WatchdogDeviceDestroy(Watchdog:PWatchdogDevice):LongWord;
Description: Destroy an existing Watchdog entry


[Expand]
function WatchdogDeviceRegister(Watchdog:PWatchdogDevice):LongWord;
Description: Register a new Watchdog in the Watchdog table


[Expand]
function WatchdogDeviceDeregister(Watchdog:PWatchdogDevice):LongWord;
Description: Deregister a Watchdog from the Watchdog table


[Expand]
function WatchdogDeviceFind(WatchdogId:LongWord):PWatchdogDevice;
Description: To be documented


[Expand]
function WatchdogDeviceFindByName(const Name:String):PWatchdogDevice; inline;
Description: To be documented


[Expand]
function WatchdogDeviceFindByDescription(const Description:String):PWatchdogDevice; inline;
Description: To be documented


[Expand]
function WatchdogDeviceEnumerate(Callback:TWatchdogEnumerate; Data:Pointer):LongWord;
Description: To be documented


[Expand]
function WatchdogDeviceNotification(Watchdog:PWatchdogDevice; Callback:TWatchdogNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented


RTL clock functions

[Expand]
function SysClockRead:LongWord;
Description: To be documented


[Expand]
function SysClockRead64:Int64;
Description: To be documented


RTL timer (counter) functions

[Expand]
function SysTimerAvailable:Boolean;
Description: Check if a timer device is available


[Expand]
function SysTimerRead:LongWord;
Description: Read the current value of the default counter


[Expand]
function SysTimerRead64:Int64;
Description: Read the current value of the default counter


[Expand]
function SysTimerWait:LongWord;
Description: Wait for the current interval to expire on the default counter


[Expand]
function SysTimerEvent(Callback:TTimerCallback; Data:Pointer):LongWord;
Description: Schedule a function to be called when the current interval expires on the default counter


[Expand]
function SysTimerCancel:LongWord;
Description: Cancel a previously scheduled event callback function on the default counter


[Expand]
function SysTimerGetRate:LongWord;
Description: Get the current clock rate in Hz of the default counter


[Expand]
function SysTimerSetRate(Rate:LongWord):LongWord;
Description: Set the current clock rate in Hz of the default counter


[Expand]
function SysTimerGetInterval:LongWord;
Description: Get the current interval in ticks of the default counter


[Expand]
function SysTimerSetInterval(Interval:LongWord):LongWord;
Description: Set the current interval in ticks of the default counter


RTL random functions

[Expand]
function SysRandomAvailable:Boolean;
Description: Check if a random (RNG) device is available


[Expand]
procedure SysRandomize;
Description: To be documented


[Expand]
procedure SysRandomSeed(Seed:LongWord);
Description: To be documented


[Expand]
function SysRandomReadLongInt(Limit:LongInt):LongInt;
Description: To be documented


[Expand]
function SysRandomReadInt64(Limit:Int64):Int64;
Description: To be documented


[Expand]
function SysRandomReadDouble:Double;
Description: To be documented


RTL watchdog functions

[Expand]
function SysWatchdogAvailable:Boolean;
Description: Check if a watchdog timer device is available


[Expand]
function SysWatchdogStart(Milliseconds:LongWord):LongWord; 
Description: To be documented


[Expand]
function SysWatchdogStop:LongWord;
Description: To be documented


[Expand]
function SysWatchdogRefresh(Milliseconds:LongWord):LongWord;
Description: To be documented


Device helper functions

[Expand]
function DeviceGetCount:LongWord;
Description: Get the current device count


[Expand]
function DeviceCheck(Device:PDevice):PDevice;
Description: Check if the supplied Device is in the device table


[Expand]
function NotifierGetCount:LongWord;
Description: Get the current notifier count


[Expand]
function NotifierCheck(Notifier:PNotifier):PNotifier;
Description: Check if the supplied Notifier is in the notifier table


[Expand]
function DeviceBusToString(DeviceBus:LongWord):String;
Description: To be documented


[Expand]
function DeviceStateToString(DeviceState:LongWord):String;
Description: To be documented


[Expand]
function DeviceClassToString(DeviceClass:LongWord):String;
Description: To be documented


[Expand]
function NotificationToString(Notification:LongWord):String;
Description: To be documented


[Expand]
procedure DeviceLog(Level:LongWord; Device:PDevice; const AText:String);
Description: To be documented


[Expand]
procedure DeviceLogInfo(Device:PDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure DeviceLogWarn(Device:PDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure DeviceLogError(Device:PDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure DeviceLogDebug(Device:PDevice; const AText:String); inline;
Description: To be documented


Driver helper functions

[Expand]
function DriverGetCount:LongWord;
Description: Get the current driver count


[Expand]
function DriverCheck(Driver:PDriver):PDriver;
Description: Check if the supplied Driver is in the driver table


[Expand]
function DriverStateToString(DriverState:LongWord):String;
Description: To be documented


[Expand]
function DriverClassToString(DriverClass:LongWord):String;
Description: To be documented


Clock device helper functions

[Expand]
function ClockDeviceGetCount:LongWord;
Description: Get the current clock device count


[Expand]
function ClockDeviceGetDefault:PClockDevice;
Description: Get the current default clock device


[Expand]
function ClockDeviceSetDefault(Clock:PClockDevice):LongWord;
Description: Set the current default clock device


[Expand]
function ClockDeviceCheck(Clock:PClockDevice):PClockDevice;
Description: Check if the supplied Clock is in the Clock table


[Expand]
function ClockTypeToString(ClockType:LongWord):String;
Description: Convert a Clock type value to a string


[Expand]
function ClockStateToString(ClockState:LongWord):String;
Description: Convert a Clock state value to a string


Timer device helper functions

[Expand]
function TimerDeviceGetCount:LongWord;
Description: Get the current timer device count


[Expand]
function TimerDeviceGetDefault:PTimerDevice;
Description: Get the current default timer device


[Expand]
function TimerDeviceSetDefault(Timer:PTimerDevice):LongWord;
Description: Set the current default timer device


[Expand]
function TimerDeviceCheck(Timer:PTimerDevice):PTimerDevice;
Description: Check if the supplied Timer is in the Timer table


[Expand]
function TimerTypeToString(TimerType:LongWord):String;
Description: Convert a Timer type value to a string


[Expand]
function TimerStateToString(TimerState:LongWord):String;
Description: Convert a Timer state value to a string


[Expand]
function TimerDeviceCreateWaiter(Timer:PTimerDevice; Callback:TTimerCallback; Data:Pointer):PTimerWaiter;
Description: Create a new waiter using the supplied parameters


[Expand]
function TimerDeviceDestroyWaiter(Timer:PTimerDevice; Waiter:PTimerWaiter):LongWord;
Description: Destroy an existing waiter


[Expand]
function TimerDeviceRegisterWaiter(Timer:PTimerDevice; Waiter:PTimerWaiter):LongWord;
Description: Register a waiter in the waiter list of the supplied Timer


[Expand]
function TimerDeviceDeregisterWaiter(Timer:PTimerDevice; Waiter:PTimerWaiter):LongWord;
Description: Deregister a waiter from the waiter list of the supplied Timer


Random device helper functions

[Expand]
function RandomDeviceGetCount:LongWord;
Description: Get the current random device count


[Expand]
function RandomDeviceGetDefault:PRandomDevice;
Description: Get the current default random device


[Expand]
function RandomDeviceSetDefault(Random:PRandomDevice):LongWord;
Description: Set the current default random device


[Expand]
function RandomDeviceCheck(Random:PRandomDevice):PRandomDevice;
Description: Check if the supplied Random is in the Random table


[Expand]
function RandomTypeToString(RandomType:LongWord):String;
Description: Convert a Random type value to a string


[Expand]
function RandomStateToString(RandomState:LongWord):String;
Description: Convert a Random state value to a string


Mailbox device helper functions

[Expand]
function MailboxDeviceGetCount:LongWord;
Description: Get the current mailbox device count


[Expand]
function MailboxDeviceGetDefault:PMailboxDevice;
Description: Get the current default mailbox device


[Expand]
function MailboxDeviceSetDefault(Mailbox:PMailboxDevice):LongWord; 
Description: Set the current default mailbox device


[Expand]
function MailboxDeviceCheck(Mailbox:PMailboxDevice):PMailboxDevice;
Description: Check if the supplied Mailbox is in the Mailbox table


[Expand]
function MailboxTypeToString(MailboxType:LongWord):String;
Description: Convert a Mailbox type value to a string


[Expand]
function MailboxStateToString(MailboxState:LongWord):String;
Description: Convert a Mailbox state value to a string


Watchdog device helper functions

[Expand]
function WatchdogDeviceGetCount:LongWord;
Description: Get the current watchdog device count


[Expand]
function WatchdogDeviceGetDefault:PWatchdogDevice;
Description: Get the current default watchdog device


[Expand]
function WatchdogDeviceSetDefault(Watchdog:PWatchdogDevice):LongWord;
Description: Set the current default watchdog device


[Expand]
function WatchdogDeviceCheck(Watchdog:PWatchdogDevice):PWatchdogDevice;
Description: Check if the supplied Watchdog is in the Watchdog table


[Expand]
function WatchdogTypeToString(WatchdogType:LongWord):String;
Description: Convert a Watchdog type value to a string


[Expand]
function WatchdogStateToString(WatchdogState:LongWord):String;
Description: Convert a Watchdog state value to a string


Return to Unit Reference