Difference between revisions of "Unit Platform"

From Ultibo.org
Jump to: navigation, search
Line 1,285: Line 1,285:
 
<pre style="border: 0; padding-bottom:0px;">function MemoryGetLargePageSize:LongWord; inline;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function MemoryGetLargePageSize:LongWord; inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the large page size of system memory (Where Applicable)</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the large page size of system memory (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 />
 +
 +
'''Power 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 PowerOn(PowerId:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Power On the specified device</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 PowerOff(PowerId:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Power Off the specified device</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 PowerGetWait(PowerId:LongWord):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the enable wait time in Microseconds of the specified device</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 PowerGetState(PowerId:LongWord):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the power state of the specified device</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 PowerSetState(PowerId,State:LongWord; Wait:Boolean):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the power state of the specified device (Optionally waiting for ready)</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:28, 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

procedure PlatformInit;
Description: Initialize platform specific information for the current hardware
Note To be documented


procedure CPUInit;
Description: Initialize the CPU including performance features etc (Where Applicable)
Note To be documented


procedure FPUInit;
Description: Initialize the Floating Point Processor Unit (Where Applicable)
Note To be documented


procedure GPUInit;
Description: Initialize the Graphics Processor Unit (Where Applicable)
Note To be documented


procedure MMUInit;
Description: Initialize the Memory Management Unit (Where Applicable)
Note To be documented


procedure SMPInit;
Description: Initialize the Symetric Multi Processor support (Where Applicable)
Note Secondary CPU boot is performed by SecondaryInit in Threads


procedure CacheInit;
Description: Initialize CPU Data and Instruction Caching (Where Applicable)
Note To be documented


procedure BoardInit;
Description: Initialize Board specific information (Where Applicable)
Note To be documented


procedure MemoryInit;
Description: Initialize Memory specific information (Where Applicable)
Note To be documented


procedure ClockInit;
Description: Initialize the Clock handling
Note To be documented


procedure PowerInit;
Description: Initialize Power management (Where Applicable)
Note To be documented


procedure MailboxInit;
Description: Initialize Mailbox access (Where Applicable)
Note To be documented


procedure InterruptInit;
Description: Initialize Interrupt handling
Note To be documented


procedure PeripheralInit;
Description: Initialize Peripheral devices (Where Applicable)
Note To be documented


procedure ParseBootTags;
Description: Parse any boot tag information passed by the bootloader (Where Applicable)
Note To be documented


procedure ParseCommandLine;
Description: Setup argc, argv and cmdline and process known command line options (Where Applicable)
Note To be documented


procedure ParseEnvironment;
Description: Setup envp and process known environment options (Where Applicable)
Note To be documented


Boot functions

procedure BootBlink; inline;
Description: Blink the Activity LED (Where Applicable)
Note Intended for startup diagnostics when bootstrapping a new board


LED functions

procedure PowerLEDEnable; inline;
Description: Enable the Power LED (Where Applicable)
Note To be documented


procedure PowerLEDOn; inline;
Description: Turn On the Power LED (Where Applicable)
Note To be documented


procedure PowerLEDOff; inline;
Description: Turn Off the Power LED (Where Applicable)
Note To be documented


procedure ActivityLEDEnable; inline;
Description: Enable the Activity LED (Where Applicable)
Note To be documented


procedure ActivityLEDOn; inline;
Description: Turn On the Activity LED (Where Applicable)
Note To be documented


procedure ActivityLEDOff; inline;
Description: Turn Off the Activity LED (Where Applicable)
Note To be documented


Counter functions (Timer device)

function CounterAvailable:Boolean; inline;
Description: Check if a counter is currently available
Note To be documented


function CounterRead:LongWord; inline;
Description: Read the current value of the default counter
Return The 32 bit current value of the current or 0 on failure


function CounterRead64:Int64; inline;
Description: Read the current value of the default counter
Return The 64 bit current value of the current or 0 on failure


function CounterWait:LongWord; inline;
Description: Wait for the current interval to expire on the default counter
Return ERROR_SUCCESS if the interval expired or another error code on failure


function CounterEvent(Callback:TCounterCallback; Data:Pointer):LongWord; inline;
Description: Schedule a function to be called when the current interval expires on the default counter
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


function CounterGetRate:LongWord; inline;
Description: Get the current clock rate in Hz of the default counter
Return The current clock rate in Hz or 0 on failure


function CounterSetRate(Rate:LongWord):LongWord; inline;
Description: Set the current clock rate in Hz of the default counter
Rate The clock rate in Hz to set
Return ERROR_SUCCESS if the clock rate was set or another error code on failure


function CounterGetInterval:LongWord; inline;
Description: Get the current interval in milliseconds of the default counter
Return The current interval in milliseconds or 0 on failure (or not set)


function CounterSetInterval(Interval:LongWord):LongWord; inline;
Description: Set the current interval in milliseconds of the default counter
Interval The interval in milliseconds to set
Return ERROR_SUCCESS if the interval was set or another error code on failure


Mailbox functions

function MailboxReceive(Mailbox,Channel:LongWord):LongWord; inline;
Description: Receive from specifed mailbox on specified channel
Note To be documented


procedure MailboxSend(Mailbox,Channel,Data:LongWord); inline;
Description: Send to specifed mailbox on specified channel
Note To be documented


function MailboxCall(Mailbox,Channel,Data:LongWord; var Response:LongWord):LongWord; inline;
Description: Perform a transaction (Send/Receive) to specifed mailbox on specified channel
Note To be documented


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


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


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


Random number functions

function RandomAvailable:Boolean; inline;
Description: Check if a hardware random number generator is currently available
Note The software random number generator from the RTL is always available


procedure RandomSeed(Seed:LongWord); inline;
Description: To be documented
Note To be documented


function RandomReadLongInt(Limit:LongInt):LongInt; inline;
Description: To be documented
Note To be documented


function RandomReadInt64(Limit:Int64):Int64; inline;
Description: To be documented
Note To be documented


function RandomReadExtended:Extended; inline;
Description: To be documented
Note To be documented


Watchdog Timer Functions

function WatchdogAvailable:Boolean; inline; 
Description: Check if a watchdog timer is currently available
Note To be documented


function WatchdogStart(Milliseconds:LongWord):LongWord; inline;
Description: To be documented
Note To be documented


function WatchdogStop:LongWord; inline;
Description: To be documented
Note To be documented


function WatchdogRefresh(Milliseconds:LongWord):LongWord; inline;
Description: To be documented
Note To be documented


Interrupt request (IRQ) functions

function RequestIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; Parameter:Pointer):LongWord; inline;
Description: Request registration of the supplied handler to the specified IRQ number
Note If the IRQ number is already registered then the request will fail


function ReleaseIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; Parameter:Pointer):LongWord; inline;
Description: Request deregistration of the supplied handler from the specified IRQ number
Note If the IRQ number is not currently registered then the request will fail


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
Note If the IRQ number is already registered then the request will fail


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
Note If the IRQ number is not currently registered then the request will fail


Fast interrupt request (FIQ) functions

function RequestFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; Parameter:Pointer):LongWord; inline;
Description: Request registration of the supplied handler to the specified FIQ number
Note If the FIQ number is already registered then the request will fail


function ReleaseFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; Parameter:Pointer):LongWord; inline;
Description: Request deregistration of the supplied handler from the specified FIQ number
Note If the FIQ number is not currently registered then the request will fail


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
Note If the FIQ number is already registered then the request will fail


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
Note If the FIQ number is not currently registered then the request will fail


System functions

function SystemRestart(Delay:LongWord):LongWord; inline;
Description: Restart the system
Note To be documented


function SystemShutdown(Delay:LongWord):LongWord; inline;
Description: Shutdown the system
Note To be documented


function SystemGetUptime:Int64; inline;
Description: Get the current system up time in 100 nanosecond ticks since 1/1/1601
Return The current system up time
Note This is the same time format as Windows FILE_TIME and is intended to allow compatibility with file system functions etc


function SystemGetCommandLine:String; inline;
Description: Get the current command line
Note To be documented


function SystemGetEnvironment:Pointer; inline;
Description: Get the current environment
Note To be documented


procedure SystemCall(Number:LongWord; Param1,Param2,Param3:PtrUInt); inline;
Description: Perform a System Call function with the supplied parameters (Where Applicable)
Note To be documented


CPU Functions

function CPUGetArch:LongWord; inline;
Description: Get the CPU architecture for this board
Note To be documented


function CPUGetType:LongWord; inline;
Description: Get the CPU type for this board
Note To be documented


function CPUGetBoot:LongWord; inline;
Description: Get the boot CPU for this board
Note To be documented


function CPUGetMask:LongWord; inline;
Description: Get the CPU mask for this board
Note To be documented


function CPUGetCount:LongWord; inline;
Description: Get the CPU count for this board
Note To be documented


function CPUGetMode:LongWord; inline;
Description: Get the current CPU moded
Note The return value is specific to the CPU type


function CPUGetState:LongWord; inline;
Description: Get the current CPU state
Note To be documented


function CPUGetCurrent:LongWord; inline;
Description: Get the current CPU ID
Note To be documented


function CPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord; inline;
Description: Get the memory start and size available to the CPU
Note To be documented


function CPUGetPercentage(CPUID:LongWord):Double; inline;
Description: Get the last second ulitization of the specified CPU in percentage
CPUID The CPU to get utilization from or CPU_ID_ALL for average of all CPUs


function CPUGetUtilization(CPUID:LongWord):LongWord; inline;
Description: Get the last second ulitization of the specified CPU
CPUID The CPU to get utilization from or CPU_ID_ALL for average of all CPUs


function CPUGetModel:LongWord; inline;
Description: Get the CPU model of the current CPU
Note To be documented


function CPUGetRevision:LongWord; inline;
Description: Get the CPU revision of the current CPU
Note The return value is specific to the CPU type and model


function CPUGetDescription:String; inline;
Description: Get the CPU description of the current CPU
Note To be documented


FPU functions

function FPUGetType:LongWord; inline;
Description: Get the FPU type for this board
Note To be documented


function FPUGetState:LongWord; inline;
Description: Get the current FPU state
Note To be documented


GPU functions

function GPUGetType:LongWord; inline;
Description: Get the GPU type for this board
Note To be documented


function GPUGetState:LongWord; inline;
Description: Get the current GPU state
Note To be documented


function GPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord; inline;
Description: Get the memory start and size available to the GPU
Note To be documented


Cache functions

function L1CacheGetType:LongWord; inline;
Description: Get the L1 cache type for this board
Note To be documented


function L1DataCacheGetSize:LongWord; inline;
Description: Get the L1 data cache size for this board
Note If data cache is not supported, the size returned is zero. If separate data and instruction caches are not supported, the size returned is the unified size.


function L1DataCacheGetLineSize:LongWord; inline;
Description: Get the L1 data cache line size for this board
Note If data cache is not supported, the size returned is zero. If separate data and instruction caches are not supported, the size returned is the unified size.


function L1InstructionCacheGetSize:LongWord; inline; 
Description: Get the L1 instruction cache size for this board
Note If instruction cache is not supported, the size returned is zero. If separate data and instruction caches are not supported, the size returned is the unified size.


function L1InstructionCacheGetLineSize:LongWord; inline;
Description: Get the L1 instruction cache line size for this board
Note If instruction cache is not supported, the size returned is zero. If separate data and instruction caches are not supported, the size returned is the unified size.


function L2CacheGetType:LongWord; inline;
Description: Get the L2 cache type for this board
Note To be documented


function L2CacheGetSize:LongWord; inline;
Description: Get the L2 cache size for this board
Note If L2 cache is not supported, the size returned is zero


function L2CacheGetLineSize:LongWord; inline;
Description: Get the L2 cache line size for this board
Note If L2 cache is not supported, the size returned is zero


Board functions

function BoardGetType:LongWord; inline;
Description: Get the current Board type
Note To be documented


function BoardGetModel:LongWord; inline;
Description: Get the current Board model
Note To be documented


function BoardGetSerial:Int64; inline;
Description: Get the current Board serial number
Note To be documented


function BoardGetRevision:LongWord; inline;
Description: Get the current Board revision number
Note To be documented


function BoardGetMACAddress:String; inline;
Description: Get the current Board MAC address (Where Applicable)
Note To be documented


Firmware functions

function FirmwareGetRevision:LongWord; inline;
Description: Get the current board Firmware Revision
Note To be documented


Machine functions

function MachineGetType:LongWord; inline;
Description: Get the current Machine type
Note To be documented


Memory functions

function MemoryGetBase:PtrUInt; inline;
Description: Get the base address of system memory
Note To be documented


function MemoryGetSize:LongWord; inline;
Description: Get the total size of system memory
Note To be documented


function MemoryGetPageSize:LongWord; inline;
Description: Get the page size of system memory
Note To be documented


function MemoryGetLargePageSize:LongWord; inline;
Description: Get the large page size of system memory (Where Applicable)
Note To be documented


Power functions

function PowerOn(PowerId:LongWord):LongWord;
Description: Power On the specified device
Note To be documented


function PowerOff(PowerId:LongWord):LongWord;
Description: Power Off the specified device
Note To be documented


function PowerGetWait(PowerId:LongWord):LongWord; inline;
Description: Get the enable wait time in Microseconds of the specified device
Note To be documented


function PowerGetState(PowerId:LongWord):LongWord; inline;
Description: Get the power state of the specified device
Note To be documented


function PowerSetState(PowerId,State:LongWord; Wait:Boolean):LongWord; inline;
Description: Set the power state of the specified device (Optionally waiting for ready)
Note To be documented



Return to Unit Reference