Difference between revisions of "Unit Devices"
Line 702: | Line 702: | ||
<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 TimerDeviceGetRate(Timer:PTimerDevice):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function TimerDeviceGetRate(Timer:PTimerDevice):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current clock rate in Hz 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 get the rate from |
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The current clock rate in Hz or 0 on failure | ||
|- | |- | ||
|} | |} | ||
Line 714: | Line 717: | ||
<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 TimerDeviceSetRate(Timer:PTimerDevice; Rate:LongWord):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function TimerDeviceSetRate(Timer:PTimerDevice; Rate:LongWord):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current clock rate in Hz 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 set the rate for |
+ | |- | ||
+ | ! '''Rate''' | ||
+ | | The clock rate in Hz to set | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if the clock rate was set or another error code on failure | ||
|- | |- | ||
|} | |} | ||
Line 726: | Line 735: | ||
<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 TimerDeviceGetInterval(Timer:PTimerDevice):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function TimerDeviceGetInterval(Timer:PTimerDevice):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current interval in ticks 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 get the interval from | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The current interval in ticks or 0 on failure (or not set) | ||
|- | |- | ||
! '''Note''' | ! '''Note''' | ||
− | | | + | | The tick rate is determined by the clock rate |
|- | |- | ||
|} | |} | ||
Line 738: | Line 753: | ||
<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 TimerDeviceSetInterval(Timer:PTimerDevice; Interval:LongWord):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function TimerDeviceSetInterval(Timer:PTimerDevice; Interval:LongWord):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current interval in ticks 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 set the interval for | ||
+ | |- | ||
+ | ! '''Interval''' | ||
+ | | The interval in ticks to set | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if the interval was set or another error code on failure | ||
|- | |- | ||
! '''Note''' | ! '''Note''' | ||
− | | | + | | The tick rate is determined by the clock rate |
|- | |- | ||
|} | |} | ||
Line 750: | Line 774: | ||
<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 TimerDeviceProperties(Timer:PTimerDevice; Properties:PTimerProperties):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function TimerDeviceProperties(Timer:PTimerDevice; Properties:PTimerProperties):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the properties for 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 get properties from |
+ | |- | ||
+ | ! '''Properties''' | ||
+ | | Pointer to a TTimerProperties structure to fill in | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
|} | |} |
Revision as of 23:35, 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 TimerDeviceCancel(Timer:PTimerDevice):LongWord;
function TimerDeviceGetRate(Timer:PTimerDevice):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