Difference between revisions of "Unit Devices"
Line 591: | Line 591: | ||
<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 TimerDeviceStart(Timer:PTimerDevice):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function TimerDeviceStart(Timer:PTimerDevice):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Start the clock and counter of the specified Timer 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;" | ||
|- | |- | ||
− | ! ''' | + | ! '''Timer''' |
− | | | + | | The Timer device to start |
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
|} | |} | ||
Line 603: | Line 606: | ||
<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 TimerDeviceStop(Timer:PTimerDevice):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function TimerDeviceStop(Timer:PTimerDevice):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Stop the clock and counter of the specified Timer 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;" | ||
|- | |- | ||
− | ! ''' | + | ! '''Timer''' |
− | | | + | | The Timer device to stop |
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
|} | |} | ||
Line 615: | Line 621: | ||
<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 TimerDeviceRead(Timer:PTimerDevice):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function TimerDeviceRead(Timer:PTimerDevice):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Read the current value of the specified Timer 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;" | ||
|- | |- | ||
− | ! ''' | + | ! '''Timer''' |
− | | | + | | The Timer device to read from |
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The 32 bit current value of the timer or 0 on failure | ||
|- | |- | ||
|} | |} | ||
Line 627: | Line 636: | ||
<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 TimerDeviceRead64(Timer:PTimerDevice):Int64;</pre> | <pre style="border: 0; padding-bottom:0px;">function TimerDeviceRead64(Timer:PTimerDevice):Int64;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Read the current value of the specified Timer 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;" | ||
|- | |- | ||
− | ! ''' | + | ! '''Timer''' |
− | | | + | | The Timer device to read from |
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The 64 bit current value of the timer or 0 on failure | ||
|- | |- | ||
|} | |} | ||
Line 639: | Line 651: | ||
<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 TimerDeviceWait(Timer:PTimerDevice):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function TimerDeviceWait(Timer:PTimerDevice):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wait for the current interval to expire on the specified Timer 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;" | ||
|- | |- | ||
− | ! ''' | + | ! '''Timer''' |
− | | | + | | The Timer device to wait for |
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if the interval expired or another error code on failure | ||
|- | |- | ||
|} | |} | ||
Line 651: | Line 666: | ||
<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 TimerDeviceEvent(Timer:PTimerDevice; Flags:LongWord; Callback:TTimerCallback; Data:Pointer):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function TimerDeviceEvent(Timer:PTimerDevice; Flags:LongWord; Callback:TTimerCallback; Data:Pointer):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Schedule a function to be called when the current interval expires on the specified Timer 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;" | ||
|- | |- | ||
− | ! ''' | + | ! '''Timer''' |
− | | | + | | The Timer device to schedule the callback for |
+ | |- | ||
+ | ! '''Callback''' | ||
+ | | The function to be called when the interval expires | ||
+ | |- | ||
+ | ! '''Data''' | ||
+ | | A pointer to be pass to the function when the interval expires (Optional) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if the callback was scheduled successfully or another error code on failure | ||
|- | |- | ||
|} | |} |
Revision as of 23:32, 6 October 2016
Return to Unit Reference
Contents
[hide]Description
To be documented
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
procedure DevicesInit;
Device functions
function DeviceDestroy(Device:PDevice):LongWord;
function DeviceGetName(Device:PDevice):String;
function DeviceSetName(Device:PDevice; const Name:String):LongWord;
function DeviceGetDescription(Device:PDevice):String;
function DeviceSetDescription(Device:PDevice; const Description:String):LongWord;
function DeviceRegister(Device:PDevice):LongWord;
function DeviceDeregister(Device:PDevice):LongWord;
function DeviceFindByDescription(const Description:String):PDevice;
function DeviceEnumerate(DeviceClass:LongWord; Callback:TDeviceEnumerate; Data:Pointer):LongWord;
function DeviceNotification(Device:PDevice; DeviceClass:LongWord; Callback:TDeviceNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
function NotifierAllocate(Device:PDevice; DeviceClass:LongWord; Callback:TDeviceNotification; Data:Pointer; Notification,Flags:LongWord):PNotifier;
function NotifierRelease(Notifier:PNotifier):LongWord;
function NotifierFind(Device:PDevice; DeviceClass:LongWord; Callback:TDeviceNotification; Data:Pointer):PNotifier;
function NotifierNotify(Device:PDevice; Notification:LongWord):LongWord;
Driver functions
function DriverDestroy(Driver:PDriver):LongWord;
function DriverGetName(Driver:PDriver):String;
function DriverSetName(Driver:PDriver; const Name:String):LongWord;
function DriverRegister(Driver:PDriver):LongWord;
function DriverDeregister(Driver:PDriver):LongWord;
function DriverEnumerate(DriverClass:LongWord; Callback:TDriverEnumerate; Data:Pointer):LongWord;
Clock device functions
function ClockDeviceWrite64(Clock:PClockDevice; const Value:Int64):LongWord;
function ClockDeviceCreateEx(Size:LongWord):PClockDevice;
function ClockDeviceDestroy(Clock:PClockDevice):LongWord;
function ClockDeviceRegister(Clock:PClockDevice):LongWord;
function ClockDeviceDeregister(Clock:PClockDevice):LongWord;
function ClockDeviceFindByName(const Name:String):PClockDevice; inline;
function ClockDeviceFindByDescription(const Description:String):PClockDevice; inline;
function ClockDeviceEnumerate(Callback:TClockEnumerate; Data:Pointer):LongWord;
function ClockDeviceNotification(Clock:PClockDevice; Callback:TClockNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Timer device functions
function TimerDeviceStart(Timer:PTimerDevice):LongWord;
function TimerDeviceStop(Timer:PTimerDevice):LongWord;
function TimerDeviceRead(Timer:PTimerDevice):LongWord;
function TimerDeviceRead64(Timer:PTimerDevice):Int64;
function TimerDeviceWait(Timer:PTimerDevice):LongWord;
function TimerDeviceEvent(Timer:PTimerDevice; Flags:LongWord; Callback:TTimerCallback; Data:Pointer):LongWord;
function TimerDeviceSetRate(Timer:PTimerDevice; Rate:LongWord):LongWord;
function TimerDeviceGetInterval(Timer:PTimerDevice):LongWord;
function TimerDeviceSetInterval(Timer:PTimerDevice; Interval:LongWord):LongWord;
function TimerDeviceProperties(Timer:PTimerDevice; Properties:PTimerProperties):LongWord;
function TimerDeviceCreateEx(Size:LongWord):PTimerDevice;
function TimerDeviceDestroy(Timer:PTimerDevice):LongWord;
function TimerDeviceRegister(Timer:PTimerDevice):LongWord;
function TimerDeviceDeregister(Timer:PTimerDevice):LongWord;
function TimerDeviceFindByName(const Name:String):PTimerDevice; inline;
function TimerDeviceFindByDescription(const Description:String):PTimerDevice; inline;
function TimerDeviceEnumerate(Callback:TTimerEnumerate; Data:Pointer):LongWord;
function TimerDeviceNotification(Timer:PTimerDevice; Callback:TTimerNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Random device functions
function RandomDeviceSeed(Random:PRandomDevice; Seed:LongWord):LongWord;
function RandomDeviceReadLongWord(Random:PRandomDevice):LongWord;
function RandomDeviceReadQuadWord(Random:PRandomDevice):Int64;
function RandomDeviceReadExtended(Random:PRandomDevice):Extended;
function RandomDeviceCreateEx(Size:LongWord):PRandomDevice;
function RandomDeviceDestroy(Random:PRandomDevice):LongWord;
function RandomDeviceRegister(Random:PRandomDevice):LongWord;
function RandomDeviceDeregister(Random:PRandomDevice):LongWord;
function RandomDeviceFindByName(const Name:String):PRandomDevice; inline;
function RandomDeviceFindByDescription(const Description:String):PRandomDevice; inline;
function RandomDeviceEnumerate(Callback:TRandomEnumerate; Data:Pointer):LongWord;
function RandomDeviceNotification(Random:PRandomDevice; Callback:TRandomNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Mailbox device functions
function MailboxDeviceStart(Mailbox:PMailboxDevice):LongWord;
function MailboxDeviceReceive(Mailbox:PMailboxDevice; Channel:LongWord):LongWord;
function MailboxDeviceSend(Mailbox:PMailboxDevice; Channel,Data:LongWord):LongWord;
function MailboxDeviceCall(Mailbox:PMailboxDevice; Channel,Data:LongWord; var Response:LongWord):LongWord;
function MailboxDeviceGetTimeout(Mailbox:PMailboxDevice):LongWord;
function MailboxDeviceSetTimeout(Mailbox:PMailboxDevice; Timeout:LongWord):LongWord;
function MailboxDeviceCreateEx(Size:LongWord):PMailboxDevice;
function MailboxDeviceDestroy(Mailbox:PMailboxDevice):LongWord;
function MailboxDeviceRegister(Mailbox:PMailboxDevice):LongWord;
function MailboxDeviceDeregister(Mailbox:PMailboxDevice):LongWord;
function MailboxDeviceFind(MailboxId:LongWord):PMailboxDevice;
function MailboxDeviceFindByName(const Name:String):PMailboxDevice; inline;
function MailboxDeviceFindByDescription(const Description:String):PMailboxDevice; inline;
function MailboxDeviceEnumerate(Callback:TMailboxEnumerate; Data:Pointer):LongWord;
function MailboxDeviceNotification(Mailbox:PMailboxDevice; Callback:TMailboxNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Watchdog device functions
function WatchdogDeviceStart(Watchdog:PWatchdogDevice):LongWord;
function WatchdogDeviceStop(Watchdog:PWatchdogDevice):LongWord;
function WatchdogDeviceRefresh(Watchdog:PWatchdogDevice):LongWord;
function WatchdogDeviceGetRemain(Watchdog:PWatchdogDevice):LongWord;
function WatchdogDeviceGetTimeout(Watchdog:PWatchdogDevice):LongWord;
function WatchdogDeviceSetTimeout(Watchdog:PWatchdogDevice; Timeout:LongWord):LongWord;
function WatchdogDeviceCreateEx(Size:LongWord):PWatchdogDevice;
function WatchdogDeviceDestroy(Watchdog:PWatchdogDevice):LongWord;
function WatchdogDeviceRegister(Watchdog:PWatchdogDevice):LongWord;
function WatchdogDeviceDeregister(Watchdog:PWatchdogDevice):LongWord;
function WatchdogDeviceFind(WatchdogId:LongWord):PWatchdogDevice;
function WatchdogDeviceFindByName(const Name:String):PWatchdogDevice; inline;
function WatchdogDeviceFindByDescription(const Description:String):PWatchdogDevice; inline;
function WatchdogDeviceEnumerate(Callback:TWatchdogEnumerate; Data:Pointer):LongWord;
function WatchdogDeviceNotification(Watchdog:PWatchdogDevice; Callback:TWatchdogNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
RTL clock functions
RTL timer (counter) functions
function SysTimerWait:LongWord;
function SysTimerEvent(Callback:TTimerCallback; Data:Pointer):LongWord;
function SysTimerGetRate:LongWord;
function SysTimerSetRate(Rate:LongWord):LongWord;
function SysTimerGetInterval:LongWord;
function SysTimerSetInterval(Interval:LongWord):LongWord;
RTL random functions
function SysRandomAvailable:Boolean;
RTL watchdog functions
function SysWatchdogAvailable:Boolean;
Device helper functions
function DeviceCheck(Device:PDevice):PDevice;
function NotifierCheck(Notifier:PNotifier):PNotifier;
procedure DeviceLog(Level:LongWord; Device:PDevice; const AText:String);
procedure DeviceLogError(Device:PDevice; const AText:String);
procedure DeviceLogDebug(Device:PDevice; const AText:String);
Driver helper functions
function DriverCheck(Driver:PDriver):PDriver;
Clock device helper functions
function ClockDeviceGetCount:LongWord; inline;
function ClockDeviceGetDefault:PClockDevice; inline;
function ClockDeviceSetDefault(Clock:PClockDevice):LongWord;
function ClockDeviceCheck(Clock:PClockDevice):PClockDevice;
Timer device helper functions
function TimerDeviceGetCount:LongWord; inline;
function TimerDeviceGetDefault:PTimerDevice; inline;
function TimerDeviceSetDefault(Timer:PTimerDevice):LongWord;
function TimerDeviceCheck(Timer:PTimerDevice):PTimerDevice;
Random device helper functions
function RandomDeviceGetCount:LongWord; inline;
function RandomDeviceGetDefault:PRandomDevice; inline;
function RandomDeviceSetDefault(Random:PRandomDevice):LongWord;
function RandomDeviceCheck(Random:PRandomDevice):PRandomDevice;
Mailbox device helper functions
function MailboxDeviceGetCount:LongWord; inline;
function MailboxDeviceGetDefault:PMailboxDevice; inline;
function MailboxDeviceSetDefault(Mailbox:PMailboxDevice):LongWord;
function MailboxDeviceCheck(Mailbox:PMailboxDevice):PMailboxDevice;
Watchdog device helper functions
function WatchdogDeviceGetCount:LongWord; inline;
function WatchdogDeviceGetDefault:PWatchdogDevice; inline;
function WatchdogDeviceSetDefault(Watchdog:PWatchdogDevice):LongWord;
function WatchdogDeviceCheck(Watchdog:PWatchdogDevice):PWatchdogDevice;
Return to Unit Reference