Difference between revisions of "Unit Platform"

From Ultibo.org
Jump to: navigation, search
Line 805: Line 805:
 
<pre style="border: 0; padding-bottom:0px;">procedure SystemCall(Number:LongWord; Param1,Param2,Param3:PtrUInt); inline;</pre>
 
<pre style="border: 0; padding-bottom:0px;">procedure SystemCall(Number:LongWord; Param1,Param2,Param3:PtrUInt); inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a System Call function with the supplied parameters (Where Applicable)</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a System Call function with the supplied parameters (Where Applicable)</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| To be documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''CPU Functions'''
 +
 +
<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 CPUGetArch:LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the CPU architecture for this board</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| To be documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetType:LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the CPU type for this board</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| To be documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetBoot:LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the boot CPU for this board</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| To be documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetMask:LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the CPU mask for this board</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| To be documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetCount:LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the CPU count for this board</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| To be documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetMode:LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current CPU moded</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| The return value is specific to the CPU type
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetState:LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current CPU state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| To be documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetCurrent:LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current CPU ID</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| To be documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the memory start and size available to the CPU</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| To be documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetPercentage(CPUID:LongWord):Double; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the last second ulitization of the specified CPU in percentage</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''CPUID'''
 +
| The CPU to get utilization from or CPU_ID_ALL for average of all CPUs
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetUtilization(CPUID:LongWord):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the last second ulitization of the specified CPU</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''CPUID'''
 +
| The CPU to get utilization from or CPU_ID_ALL for average of all CPUs
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetModel:LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the CPU model of the current CPU</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| To be documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetRevision:LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the CPU revision of the current CPU</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| The return value is specific to the CPU type and model
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 CPUGetDescription:String; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the CPU description of the current CPU</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;"

Revision as of 05:24, 22 August 2016

Return to Unit Reference


Description


To be documented

Constants


To be documented

Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

[Expand]
procedure PlatformInit;
Description: Initialize platform specific information for the current hardware


[Expand]
procedure CPUInit;
Description: Initialize the CPU including performance features etc (Where Applicable)


[Expand]
procedure FPUInit;
Description: Initialize the Floating Point Processor Unit (Where Applicable)


[Expand]
procedure GPUInit;
Description: Initialize the Graphics Processor Unit (Where Applicable)


[Expand]
procedure MMUInit;
Description: Initialize the Memory Management Unit (Where Applicable)


[Expand]
procedure SMPInit;
Description: Initialize the Symetric Multi Processor support (Where Applicable)


[Expand]
procedure CacheInit;
Description: Initialize CPU Data and Instruction Caching (Where Applicable)


[Expand]
procedure BoardInit;
Description: Initialize Board specific information (Where Applicable)


[Expand]
procedure MemoryInit;
Description: Initialize Memory specific information (Where Applicable)


[Expand]
procedure ClockInit;
Description: Initialize the Clock handling


[Expand]
procedure PowerInit;
Description: Initialize Power management (Where Applicable)


[Expand]
procedure MailboxInit;
Description: Initialize Mailbox access (Where Applicable)


[Expand]
procedure InterruptInit;
Description: Initialize Interrupt handling


[Expand]
procedure PeripheralInit;
Description: Initialize Peripheral devices (Where Applicable)


[Expand]
procedure ParseBootTags;
Description: Parse any boot tag information passed by the bootloader (Where Applicable)


[Expand]
procedure ParseCommandLine;
Description: Setup argc, argv and cmdline and process known command line options (Where Applicable)


[Expand]
procedure ParseEnvironment;
Description: Setup envp and process known environment options (Where Applicable)


Boot functions

[Expand]
procedure BootBlink; inline;
Description: Blink the Activity LED (Where Applicable)


LED functions

[Expand]
procedure PowerLEDEnable; inline;
Description: Enable the Power LED (Where Applicable)


[Expand]
procedure PowerLEDOn; inline;
Description: Turn On the Power LED (Where Applicable)


[Expand]
procedure PowerLEDOff; inline;
Description: Turn Off the Power LED (Where Applicable)


[Expand]
procedure ActivityLEDEnable; inline;
Description: Enable the Activity LED (Where Applicable)


[Expand]
procedure ActivityLEDOn; inline;
Description: Turn On the Activity LED (Where Applicable)


[Expand]
procedure ActivityLEDOff; inline;
Description: Turn Off the Activity LED (Where Applicable)


Counter functions (Timer device)

[Expand]
function CounterAvailable:Boolean; inline;
Description: Check if a counter is currently available


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


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


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


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


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


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


[Expand]
function CounterGetInterval:LongWord; inline;
Description: Get the current interval in milliseconds of the default counter


[Expand]
function CounterSetInterval(Interval:LongWord):LongWord; inline;
Description: Set the current interval in milliseconds of the default counter


Mailbox functions

[Expand]
function MailboxReceive(Mailbox,Channel:LongWord):LongWord; inline;
Description: Receive from specifed mailbox on specified channel


[Expand]
procedure MailboxSend(Mailbox,Channel,Data:LongWord); inline;
Description: Send to specifed mailbox on specified channel


[Expand]
function MailboxCall(Mailbox,Channel,Data:LongWord; var Response:LongWord):LongWord; inline;
Description: Perform a transaction (Send/Receive) to specifed mailbox on specified channel


[Expand]
function MailboxCallEx(Mailbox,Channel,Data:LongWord; var Response:LongWord; Timeout:LongWord):LongWord; inline;
Description: Perform a transaction (Send/Receive) to specifed mailbox on specified channel


[Expand]
function MailboxPropertyCall(Mailbox,Channel:LongWord; Data:Pointer; var Response:LongWord):LongWord; inline;
Description: Perform a property tag transaction (Send/Receive) to specifed mailbox on specified channel


[Expand]
function MailboxPropertyCallEx(Mailbox,Channel:LongWord; Data:Pointer; var Response:LongWord; Timeout:LongWord):LongWord; inline;
Description: Perform a property tag transaction (Send/Receive) to specifed mailbox on specified channel


Random number functions

[Expand]
function RandomAvailable:Boolean; inline;
Description: Check if a hardware random number generator is currently available


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


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


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


[Expand]
function RandomReadExtended:Extended; inline;
Description: To be documented


Watchdog Timer Functions

[Expand]
function WatchdogAvailable:Boolean; inline; 
Description: Check if a watchdog timer is currently available


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


[Expand]
function WatchdogStop:LongWord; inline;
Description: To be documented


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


Interrupt request (IRQ) functions

[Expand]
function RequestIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; Parameter:Pointer):LongWord; inline;
Description: Request registration of the supplied handler to the specified IRQ number


[Expand]
function ReleaseIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; Parameter:Pointer):LongWord; inline;
Description: Request deregistration of the supplied handler from the specified IRQ number


[Expand]
function RequestExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord; inline;
Description: Request registration of the supplied extended handler to the specified IRQ number


[Expand]
function ReleaseExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord; inline;
Description: Request deregistration of the supplied extended handler from the specified IRQ number


Fast interrupt request (FIQ) functions

[Expand]
function RequestFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; Parameter:Pointer):LongWord; inline;
Description: Request registration of the supplied handler to the specified FIQ number


[Expand]
function ReleaseFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; Parameter:Pointer):LongWord; inline;
Description: Request deregistration of the supplied handler from the specified FIQ number


[Expand]
function RequestExFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord; inline;
Description: Request registration of the supplied extended handler to the specified FIQ number


[Expand]
function ReleaseExFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord; inline;
Description: Request deregistration of the supplied extended handler from the specified FIQ number


System functions

[Expand]
function SystemRestart(Delay:LongWord):LongWord; inline;
Description: Restart the system


[Expand]
function SystemShutdown(Delay:LongWord):LongWord; inline;
Description: Shutdown the system


[Expand]
function SystemGetUptime:Int64; inline;
Description: Get the current system up time in 100 nanosecond ticks since 1/1/1601


[Expand]
function SystemGetCommandLine:String; inline;
Description: Get the current command line


[Expand]
function SystemGetEnvironment:Pointer; inline;
Description: Get the current environment


[Expand]
procedure SystemCall(Number:LongWord; Param1,Param2,Param3:PtrUInt); inline;
Description: Perform a System Call function with the supplied parameters (Where Applicable)


CPU Functions

[Expand]
function CPUGetArch:LongWord; inline;
Description: Get the CPU architecture for this board


[Expand]
function CPUGetType:LongWord; inline;
Description: Get the CPU type for this board


[Expand]
function CPUGetBoot:LongWord; inline;
Description: Get the boot CPU for this board


[Expand]
function CPUGetMask:LongWord; inline;
Description: Get the CPU mask for this board


[Expand]
function CPUGetCount:LongWord; inline;
Description: Get the CPU count for this board


[Expand]
function CPUGetMode:LongWord; inline;
Description: Get the current CPU moded


[Expand]
function CPUGetState:LongWord; inline;
Description: Get the current CPU state


[Expand]
function CPUGetCurrent:LongWord; inline;
Description: Get the current CPU ID


[Expand]
function CPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord; inline;
Description: Get the memory start and size available to the CPU


[Expand]
function CPUGetPercentage(CPUID:LongWord):Double; inline;
Description: Get the last second ulitization of the specified CPU in percentage


[Expand]
function CPUGetUtilization(CPUID:LongWord):LongWord; inline;
Description: Get the last second ulitization of the specified CPU


[Expand]
function CPUGetModel:LongWord; inline;
Description: Get the CPU model of the current CPU


[Expand]
function CPUGetRevision:LongWord; inline;
Description: Get the CPU revision of the current CPU


[Expand]
function CPUGetDescription:String; inline;
Description: Get the CPU description of the current CPU



Return to Unit Reference