Difference between revisions of "Unit PlatformRPi"

From Ultibo.org
Jump to: navigation, search
 
(9 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
'''Ultibo Platform interface unit for Raspberry Pi'''
+
'''Ultibo Platform Interface unit for Raspberry Pi'''
  
 
The RPi A+/B+ have the Power LED connected to GPIO Pin 35 (Activity LED is now on GPIO Pin 47 instead of Pin 16 in model A/B).
 
The RPi A+/B+ have the Power LED connected to GPIO Pin 35 (Activity LED is now on GPIO Pin 47 instead of Pin 16 in model A/B).
Line 41: Line 41:
 
|-
 
|-
 
| <code>RPI_STARTUP_ADDRESS = $00008000;</code>
 
| <code>RPI_STARTUP_ADDRESS = $00008000;</code>
| style="width: 50%;"|&nbsp;
+
| Address of StartupHandler on Reset (Obtain from linker)
 
|-
 
|-
 
|}
 
|}
Line 118: Line 118:
 
| <code>RPI_KERNEL_COMMAND = 'cmdline.txt';</code>
 
| <code>RPI_KERNEL_COMMAND = 'cmdline.txt';</code>
 
| &nbsp;
 
| &nbsp;
 +
|-
 +
|colspan="2"|<code>RPI_FIRMWARE_FILES = 'bootcode.bin,start.elf,fixup.dat';</code>
 +
|-
 +
|colspan="2"|<code>RPI_DTB_FILES = 'bcm2708-rpi-b.dtb,bcm2708-rpi-b-plus.dtb,bcm2708-rpi-b-rev1.dtb,bcm2708-rpi-cm.dtb,bcm2708-rpi-zero.dtb,bcm2708-rpi-zero-w.dtb';</code>
 
|-
 
|-
 
|}
 
|}
Line 303: Line 307:
 
|-
 
|-
 
| <code>Mailbox0Registers:PBCM2835Mailbox0Registers;</code>
 
| <code>Mailbox0Registers:PBCM2835Mailbox0Registers;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>Mailbox1Registers:PBCM2835Mailbox1Registers;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 317: Line 327:
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
|-
 
|-
| <code>InterruptEntries:array[0..(BCM2835_IRQ_COUNT - 1)] of TInterruptEntry;</code>
+
| <code>InterruptEntries:array[0..(BCM2835_IRQ_COUNT - 1)] of PInterruptEntry;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 629: Line 639:
 
| Data = first 28 bits, Channel = last 4 bits
 
| Data = first 28 bits, Channel = last 4 bits
 
Data pointer must be 16 byte aligned to allow for the 4 bit channel number
 
Data pointer must be 16 byte aligned to allow for the 4 bit channel number
 +
|-
 +
|}
 +
</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 RPiMailboxPropertyTag(Tag:LongWord; Data:Pointer; Size:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Request a property tag (Get/Set) from the mailbox property channel</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Data
 +
| Data does not need to include mailbox property channel header or footer. Data pointer does not need any specific alignment or caching attributes.
 +
|-
 +
! Size
 +
| Size must be a multiple of 4 bytes. Size must include the size of the request and response which use the same buffer.
 
|-
 
|-
 
|}
 
|}
Line 662: Line 687:
 
<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;"
|-
 
! CPUID
 
| CPU to route IRQ to (Ignored on RPi)
 
|-
 
! Number
 
| IRQ number to deregister
 
|-
 
! Handler
 
| Interrupt handler function to deregister
 
|-
 
! HandlerEx
 
| Extended Interrupt handler function to deregister
 
 
|-
 
|-
 
! Note
 
! Note
| Only one of Handler or HandlerEx can be specified
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 686: Line 699:
 
<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;"
|-
 
! CPUID
 
| CPU to route FIQ to (Ignored on RPi)
 
|-
 
! Number
 
| FIQ number to register
 
|-
 
! Handler
 
| Interrupt handler function to register
 
|-
 
! HandlerEx
 
| Extended Interrupt handler function to register
 
 
|-
 
|-
 
! Note
 
! Note
| Only one of Handler or HandlerEx can be specified
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 711: Line 712:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! CPUID
+
! Note
| CPU to route FIQ to (Ignored on RPi)
+
| None documented
 
|-
 
|-
! Number
+
|}
| FIQ number to deregister
+
</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 RPiRegisterInterrupt(Number,Mask,Priority,Flags:LongWord; Handler:TSharedInterruptHandler; Parameter:Pointer):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Request registration of the supplied handler to the specified interrupt number (Where Applicable)</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Handler
+
! Note
| Interrupt handler function to deregister
+
| None documented
 
|-
 
|-
! HandlerEx
+
|}
| Extended Interrupt handler function to deregister
+
</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 RPiDeregisterInterrupt(Number,Mask,Priority,Flags:LongWord; Handler:TSharedInterruptHandler; Parameter:Pointer):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Request deregistration of the supplied handler from the specified interrupt number (Where Applicable)</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
 
! Note
 
! Note
| Only one of Handler or HandlerEx can be specified
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 734: Line 747:
 
<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;"
|-
 
! CPUID
 
| The CPU Id to register the System Call against (Ignored on RPi)
 
|-
 
! Number
 
| The System Call number to be registered
 
|-
 
! Handler
 
| The handler function to be registered
 
|-
 
! HandlerEx
 
| The extended handler function to be registered
 
 
|-
 
|-
 
! Note
 
! Note
| Only one of Handler or HandlerEx can be specified
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 758: Line 759:
 
<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;"
|-
 
! CPUID
 
| The CPU Id to deregister the System Call from (Ignored on RPi)
 
|-
 
! Number
 
| The System Call number to be deregistered
 
|-
 
! Handler
 
| The handler function to be deregistered
 
|-
 
! HandlerEx
 
| The extended handler function to be deregistered
 
 
|-
 
|-
 
! Note
 
! Note
| Only one of Handler or HandlerEx can be specified
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 778: Line 767:
 
<br />
 
<br />
 
<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 RPiGetInterruptEntry(Number:LongWord):TInterruptEntry;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiGetInterruptEntry(Number,Instance:LongWord; var Interrupt:TInterruptEntry):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the interrupt entry for the specified interrupt number</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the interrupt entry for the specified interrupt number and instance</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;"
Line 838: Line 827:
 
<br />
 
<br />
 
<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 RPiCPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiCPUGetMemory(var Address:PtrUInt; var Length:UInt64):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the CPU Memory from the Mailbox property tags channel</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the CPU Memory from the Mailbox property tags channel</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;">
Line 862: Line 851:
 
<br />
 
<br />
 
<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 RPiGPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiGPUGetMemory(var Address:PtrUInt; var Length:UInt64):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the GPU Memory from the Mailbox property tags channel</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the GPU Memory from the Mailbox property tags channel</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;">
Line 924: Line 913:
 
<pre style="border: 0; padding-bottom:0px;">function RPiFirmwareGetRevision:LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function RPiFirmwareGetRevision:LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Firmware Revision from the Mailbox property tags channel</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Firmware Revision from the Mailbox property tags channel</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None 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 RPiFirmwareGetThrottled:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Firmware Throttling state from the Mailbox property tags channel</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;"
Line 1,584: Line 1,585:
 
<pre style="border: 0; padding-bottom:0px;">function RPiFramebufferTestPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function RPiFramebufferTestPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Test Framebuffer Palette from the Mailbox property tags channel</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Test Framebuffer Palette from the Mailbox property tags channel</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None 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 RPiFramebufferGetLayer(var Layer:LongInt):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get Framebuffer Layer from the Mailbox property tags channel</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None 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 RPiFramebufferSetLayer(var Layer:LongInt):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Framebuffer Layer from the Mailbox property tags channel</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None 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 RPiFramebufferTestLayer(var Layer:LongInt):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Test Framebuffer Layer from the Mailbox property tags channel</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;"
Line 1,630: Line 1,667:
 
<br />
 
<br />
 
<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 RPiTouchGetBuffer(var Address:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiFramebufferGetNumDisplays(var NumDisplays:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Touchscreen buffer from the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the number of displays from the Mailbox property tags channel</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;"
 
|-
 
|-
 
! Note
 
! Note
| On current firmware versions calling TouchGetBuffer will allocate a buffer from GPU memory and render subsequent calls to TouchSetBuffer ineffective. After an initial call to TouchSetBuffer calls to TouchGetBuffer will always return the CPU allocated buffer.
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,642: Line 1,679:
 
<br />
 
<br />
 
<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 RPiTouchSetBuffer(Address:PtrUInt):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiFramebufferGetDisplayId(DisplayNum:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the Touchscreen buffer in the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the display id for the specified display number from the Mailbox property tags channel</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;"
Line 1,654: Line 1,691:
 
<br />
 
<br />
 
<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 RPiCursorSetDefault:LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiFramebufferSetDisplayNum(DisplayNum:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor Default (Pixels) from the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the display number that all framebuffer requests will refer to using the Mailbox property tags channel</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;"
Line 1,666: Line 1,703:
 
<br />
 
<br />
 
<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 RPiCursorSetInfo(Width,Height,HotspotX,HotspotY:LongWord; Pixels:Pointer; Length:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiFramebufferGetDisplaySettings(DisplayNum:LongWord; var DisplaySettings:TDisplaySettings):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor Info (Pixels) from the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the display settings for the specified display number from the Mailbox property tags channel</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;"
Line 1,678: Line 1,715:
 
<br />
 
<br />
 
<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 RPiCursorSetState(Enabled:Boolean; X,Y:LongWord; Relative:Boolean):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiFramebufferDisplayIdToName(DisplayId:LongWord):String;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor State (Enable, X, Y) from the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the name for the specified display id</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;"
 
|-
 
|-
! Relative
+
! Note
| X, Y is relative to Display (Virtual) not Framebuffer (Physical).
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,690: Line 1,727:
 
<br />
 
<br />
 
<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 RPiDMAGetChannels:LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiTouchGetBuffer(var Address:PtrUInt):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the available DMA Channels from the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Touchscreen buffer from the Mailbox property tags channel</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;"
Line 1,701: Line 1,738:
 
</div></div>
 
</div></div>
 
<br />
 
<br />
 
'''RPi thread functions'''
 
 
 
<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;">procedure RPiSchedulerInit;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiTouchSetBuffer(Address:PtrUInt):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the Touchscreen buffer in the Mailbox property tags channel</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;"
Line 1,716: Line 1,750:
 
</div></div>
 
</div></div>
 
<br />
 
<br />
 
'''RPi IRQ functions'''
 
 
 
<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 RPiDispatchIRQ(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiCursorSetDefault:LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Process any pending IRQ requests</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor Default (Pixels) from the Mailbox property tags channel</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;"
 
|-
 
|-
 
! Note
 
! Note
| Called by ARMv6IRQHandler in PlatformARMv6
+
| None documented
A DataMemoryBarrier is executed before and after calling this function
+
 
|-
 
|-
 
|}
 
|}
Line 1,733: Line 1,763:
 
<br />
 
<br />
 
<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 RPiHandleIRQ(Number,CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiCursorSetInfo(Width,Height,HotspotX,HotspotY:LongWord; Pixels:Pointer; Length:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Call the handler function for an IRQ that was received, or halt if it doesn't exist</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor Info (Pixels) from the Mailbox property tags channel</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;"
Line 1,744: Line 1,774:
 
</div></div>
 
</div></div>
 
<br />
 
<br />
 
'''RPi FIQ functions'''
 
 
 
<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 RPiDispatchFIQ(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiCursorSetState(Enabled:Boolean; X,Y:LongWord; Relative:Boolean):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Process any pending FIQ requests</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor State (Enable, X, Y) from the Mailbox property tags channel</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Relative
 +
| X, Y is relative to Display (Virtual) not Framebuffer (Physical).
 +
|-
 +
|}
 +
</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 RPiDMAGetChannels:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the available DMA Channels from the Mailbox property tags channel</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;"
 
|-
 
|-
 
! Note
 
! Note
| Called by ARMv6FIQHandler in PlatformARMv6
+
| None documented
A DataMemoryBarrier is executed before and after calling this function
+
 
|-
 
|-
 
|}
 
|}
 
</div></div>
 
</div></div>
 
<br />
 
<br />
 +
 +
'''RPi thread functions'''
 +
 
<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 RPiHandleFIQ(Number,CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure RPiSchedulerInit;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Call the handler function for an FIQ that was received, or halt if it doesn't exist</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</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;"
Line 1,912: Line 1,953:
 
<br />
 
<br />
 
<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 RPiFramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address,Size,Flags:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPiFramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags:LongWord):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</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;">
Line 1,925: Line 1,966:
 
<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 RPiFramebufferDeviceSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function RPiFramebufferDeviceSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
! Note
 
| None 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 RPiFramebufferDeviceSetProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;</pre>
 
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</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;">
Line 2,018: Line 2,047:
 
! Note
 
! Note
 
| This currently only works for RPiA+/B+
 
| This currently only works for RPiA+/B+
 +
|-
 +
|}
 +
</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;">procedure RPiBootOutput(Value:LongWord);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Output characters to UART0 without dependency on any other RTL setup</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| This function is primarily intended for testing QEMU boot because it doesn't initialize the UART and won't work on real hardware.
 +
Based on hexstrings() function by dwelch67 (https://github.com/dwelch67)
 +
|-
 +
|}
 +
</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;">procedure RPiBootConsoleStart;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None 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;">procedure RPiBootConsoleWrite(const Value:String);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None 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;">procedure RPiBootConsoleWriteEx(const Value:String; X,Y:LongWord);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None 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 RPiBootConsoleGetX:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None 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 RPiBootConsoleGetY:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 
|-
 
|-
 
|}
 
|}

Latest revision as of 05:10, 23 November 2022

Return to Unit Reference


Description


Ultibo Platform Interface unit for Raspberry Pi

The RPi A+/B+ have the Power LED connected to GPIO Pin 35 (Activity LED is now on GPIO Pin 47 instead of Pin 16 in model A/B).

Constants



[Expand]
RPi ARM physical to VC IO mapping RPI_VCIO_*


[Expand]
RPi ARM physical to VC bus mapping RPI_VCBUS_*


[Expand]
RPi address of StartupHandler on reset RPI_STARTUP_*


[Expand]
RPi page table address and size RPI_PAGE_TABLE_*


[Expand]
RPi vector table address and size RPI_VECTOR_TABLE_*


[Expand]
RPi CPU count, boot and mask RPI_CPU_*


[Expand]
RPi SWI RPI_SWI_*


[Expand]
RPi kernel image name RPI_KERNEL_*


[Expand]
RPi plus GPIO power LED RPIPLUS_GPIO_PWRLED_*


[Expand]
RPi GPIO activity LED RPI_GPIO_ACTLED_*


[Expand]
RPi plus GPIO activity LED RPIPLUS_GPIO_ACTLED_*


[Expand]
RPi mailbox RPI_MAILBOX_*


[Expand]
RPi framebuffer RPI_FRAMEBUFFER_*


Type definitions


None defined

Public variables



RPi specific Ultibo variables

RPiInitialized:Boolean;

Timer variables

TimerRegisters:PBCM2835SystemTimerRegisters;

Mailbox variables

Mailbox0Registers:PBCM2835Mailbox0Registers;
Mailbox1Registers:PBCM2835Mailbox1Registers;

Interrupt variables

InterruptRegisters:PBCM2835InterruptRegisters;
InterruptEntries:array[0..(BCM2835_IRQ_COUNT - 1)] of PInterruptEntry;

System call

SystemCallEntries:array[0..RPI_SWI_COUNT - 1] of TSystemCallEntry;

IRQ/FIQ

IRQEnabled:array[0..2] of LongWord; 3 groups of IRQs to Enable/Disable (See: TBCM2835InterruptRegisters)
FIQEnabled:LongWord; The single IRQ number to Enable as FIQ instead (See: TBCM2835InterruptRegisters)

Watchdog variables

WatchdogRegisters:PBCM2835PMWatchdogRegisters;


Function declarations



Initialization functions

[Expand]
procedure RPiInit;
Description: To be documented


RPi platform functions

[Expand]
procedure RPiBoardInit;
Description: To be documented


[Expand]
procedure RPiMemoryInit;
Description: To be documented


[Expand]
procedure RPiClockInit;
Description: To be documented


[Expand]
procedure RPiPowerInit;
Description: To be documented


[Expand]
procedure RPiMailboxInit;
Description: To be documented


[Expand]
procedure RPiInterruptInit;
Description: To be documented


[Expand]
procedure RPiPeripheralInit;
Description: To be documented


[Expand]
procedure RPiFramebufferInit;
Description: To be documented


[Expand]
procedure RPiPageTableInit;
Description: Initialize the Hardware Page Tables before enabling the MMU


[Expand]
procedure RPiPowerLEDEnable;
Description: To be documented


[Expand]
procedure RPiPowerLEDOn;
Description: To be documented


[Expand]
procedure RPiPowerLEDOff;
Description: To be documented


[Expand]
procedure RPiActivityLEDEnable;
Description: To be documented


[Expand]
procedure RPiActivityLEDOn;
Description: To be documented


[Expand]
procedure RPiActivityLEDOff;
Description: To be documented


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


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


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


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


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


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


[Expand]
function RPiMailboxPropertyTag(Tag:LongWord; Data:Pointer; Size:LongWord):LongWord;
Description: Request a property tag (Get/Set) from the mailbox property channel


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


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


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


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


[Expand]
function RPiRegisterInterrupt(Number,Mask,Priority,Flags:LongWord; Handler:TSharedInterruptHandler; Parameter:Pointer):LongWord;
Description: Request registration of the supplied handler to the specified interrupt number (Where Applicable)


[Expand]
function RPiDeregisterInterrupt(Number,Mask,Priority,Flags:LongWord; Handler:TSharedInterruptHandler; Parameter:Pointer):LongWord;
Description: Request deregistration of the supplied handler from the specified interrupt number (Where Applicable)


[Expand]
function RPiRegisterSystemCallEx(CPUID,Number:LongWord; Handler:TSystemCallHandler; HandlerEx:TSystemCallExHandler):LongWord;
Description: Request registration of the supplied extended handler to the specified System Call number


[Expand]
function RPiDeregisterSystemCallEx(CPUID,Number:LongWord; Handler:TSystemCallHandler; HandlerEx:TSystemCallExHandler):LongWord;
Description: Request deregistration of the supplied extended handler from the specified System Call number


[Expand]
function RPiGetInterruptEntry(Number,Instance:LongWord; var Interrupt:TInterruptEntry):LongWord;
Description: Get the interrupt entry for the specified interrupt number and instance


[Expand]
function RPiGetSystemCallEntry(Number:LongWord):TSystemCallEntry;
Description: To be documented


[Expand]
function RPiSystemRestart(Delay:LongWord):LongWord;
Description: To be documented


[Expand]
function RPiSystemShutdown(Delay:LongWord):LongWord;
Description: To be documented


[Expand]
function RPiSystemGetCommandLine:String;
Description: Get the Command Line from the Mailbox property tags channel


[Expand]
function RPiCPUGetMemory(var Address:PtrUInt; var Length:UInt64):LongWord;
Description: Get the CPU Memory from the Mailbox property tags channel


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


[Expand]
function RPiGPUGetMemory(var Address:PtrUInt; var Length:UInt64):LongWord;
Description: Get the GPU Memory from the Mailbox property tags channel


[Expand]
function RPiBoardGetModel:LongWord;
Description: Get the Board Model from the Mailbox property tags channel


[Expand]
function RPiBoardGetSerial:Int64;
Description: Get the Board Serial from the Mailbox property tags channel


[Expand]
function RPiBoardGetRevision:LongWord;
Description: Get the Board Revision from the Mailbox property tags channel


[Expand]
function RPiBoardGetMACAddress:String;
Description: Get the Board MAC Address from the Mailbox property tags channel


[Expand]
function RPiFirmwareGetRevision:LongWord;
Description: Get the Firmware Revision from the Mailbox property tags channel


[Expand]
function RPiFirmwareGetThrottled:LongWord;
Description: Get the Firmware Throttling state from the Mailbox property tags channel


[Expand]
function RPiPowerGetWait(PowerId:LongWord):LongWord;
Description: Get the Power Wait from the Mailbox property tags channel


[Expand]
function RPiPowerGetState(PowerId:LongWord):LongWord;
Description: Get the Power State from the Mailbox property tags channel


[Expand]
function RPiPowerSetState(PowerId,State:LongWord; Wait:Boolean):LongWord;
Description: Set the Power State in the Mailbox property tags channel


[Expand]
function RPiClockGetCount:LongWord;
Description: Gets the current system clock count (32 least significant bits of total)


[Expand]
function RPiClockGetTotal:Int64;
Description: Gets the total system clock count


[Expand]
function RPiClockGetRate(ClockId:LongWord):LongWord;
Description: Get the Clock Rate from the Mailbox property tags channel


[Expand]
function RPiClockSetRate(ClockId,Rate:LongWord; Turbo:Boolean):LongWord;
Description: Set the Clock Rate in the Mailbox property tags channel


[Expand]
function RPiClockGetState(ClockId:LongWord):LongWord;
Description: Get the Clock State from the Mailbox property tags channel


[Expand]
function RPiClockSetState(ClockId,State:LongWord):LongWord;
Description: Set the Clock State in the Mailbox property tags channel


[Expand]
function RPiClockGetMinRate(ClockId:LongWord):LongWord;
Description: Get the Clock Min Rate from the Mailbox property tags channel


[Expand]
function RPiClockGetMaxRate(ClockId:LongWord):LongWord;
Description: Get the Clock Max Rate from the Mailbox property tags channel


[Expand]
function RPiTurboGetState(TurboId:LongWord):LongWord;
Description: Get the Turbo State from the Mailbox property tags channel


[Expand]
function RPiTurboSetState(TurboId,State:LongWord):LongWord;
Description: Set the Turbo State in the Mailbox property tags channel


[Expand]
function RPiVoltageGetValue(VoltageId:LongWord):LongWord;
Description: Get the Voltage Value from the Mailbox property tags channel


[Expand]
function RPiVoltageSetValue(VoltageId,Value:LongWord):LongWord;
Description: Set the Voltage Value in the Mailbox property tags channel


[Expand]
function RPiVoltageGetMinValue(VoltageId:LongWord):LongWord;
Description: Get the Voltage Min Value from the Mailbox property tags channel


[Expand]
function RPiVoltageGetMaxValue(VoltageId:LongWord):LongWord;
Description: Get the Voltage Max Value from the Mailbox property tags channel


[Expand]
function RPiTemperatureGetCurrent(TemperatureId:LongWord):LongWord;
Description: Get the Temperature Current from the Mailbox property tags channel


[Expand]
function RPiTemperatureGetMaximum(TemperatureId:LongWord):LongWord;
Description: Get the Temperature Maximum Model from the Mailbox property tags channel


[Expand]
function RPiGPUMemoryAllocate(Length,Alignment,Flags:LongWord):THandle;
Description: Allocate GPU Memory from the Mailbox property tags channel


[Expand]
function RPiGPUMemoryRelease(Handle:THandle):LongWord;
Description: Release GPU Memory from the Mailbox property tags channel


[Expand]
function RPiGPUMemoryLock(Handle:THandle):LongWord;
Description: Lock GPU Memory from the Mailbox property tags channel


[Expand]
function RPiGPUMemoryUnlock(Handle:THandle):LongWord;
Description: Unlock GPU Memory from the Mailbox property tags channel


[Expand]
function RPiGPUExecuteCode(Address:Pointer; R0,R1,R2,R3,R4,R5:LongWord):LongWord;
Description: Execute GPU Code from the Mailbox property tags channel


[Expand]
function RPiDispmanxHandleGet(Resource:THandle):THandle;
Description: Get Dispmanx Memory Handle from the Mailbox property tags channel


[Expand]
function RPiEDIDBlockGet(Block:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Description: Get EDID Block from the Mailbox property tags channel


[Expand]
function RPiFramebufferAllocate(Alignment:LongWord; var Address,Length:LongWord):LongWord;
Description: Allocate Framebuffer from the Mailbox property tags channel


[Expand]
function RPiFramebufferRelease:LongWord;
Description: Release Framebuffer from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetState(State:LongWord):LongWord;
Description: Set Framebuffer State (Blank Screen) from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetDimensions(var Width,Height,Top,Bottom,Left,Right:LongWord):LongWord;
Description: Get Framebuffer Dimensions from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetPhysical(var Width,Height:LongWord):LongWord;
Description: Get Framebuffer Physical size from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetPhysical(var Width,Height:LongWord):LongWord;
Description: Set Framebuffer Physical size from the Mailbox property tags channel


[Expand]
function RPiFramebufferTestPhysical(var Width,Height:LongWord):LongWord;
Description: Test Framebuffer Physical size from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetVirtual(var Width,Height:LongWord):LongWord;
Description: Get Framebuffer Virtual size from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetVirtual(var Width,Height:LongWord):LongWord;
Description: Set Framebuffer Virtual size from the Mailbox property tags channel


[Expand]
function RPiFramebufferTestVirtual(var Width,Height:LongWord):LongWord;
Description: Test Framebuffer Virtual size from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetDepth(var Depth:LongWord):LongWord;
Description: Get Framebuffer Depth (Bits per pixel) from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetDepth(var Depth:LongWord):LongWord;
Description: Set Framebuffer Depth (Bits per pixel) from the Mailbox property tags channel


[Expand]
function RPiFramebufferTestDepth(var Depth:LongWord):LongWord;
Description: Test Framebuffer Depth (Bits per pixel) from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetPixelOrder(var Order:LongWord):LongWord;
Description: Get Framebuffer Pixel Order (RGB) from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetPixelOrder(var Order:LongWord):LongWord;
Description: Set Framebuffer Pixel Order (RGB) from the Mailbox property tags channel


[Expand]
function RPiFramebufferTestPixelOrder(var Order:LongWord):LongWord;
Description: Test Framebuffer Pixel Order (RGB) from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetAlphaMode(var Mode:LongWord):LongWord;
Description: Get Framebuffer Alpha Mode from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetAlphaMode(var Mode:LongWord):LongWord;
Description: Set Framebuffer Alpha Mode from the Mailbox property tags channel


[Expand]
function RPiFramebufferTestAlphaMode(var Mode:LongWord):LongWord;
Description: Test Framebuffer Alpha Mode from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetPitch:LongWord;
Description: Get Framebuffer Pitch (Bytes per line) from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetOffset(var X,Y:LongWord):LongWord;
Description: Get Framebuffer Virtual Offset from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetOffset(var X,Y:LongWord):LongWord;
Description: Set Framebuffer Virtual Offset from the Mailbox property tags channel


[Expand]
function RPiFramebufferTestOffset(var X,Y:LongWord):LongWord;
Description: Test Framebuffer Virtual Offset from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Description: Get Framebuffer Overscan from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Description: Set Framebuffer Overscan from the Mailbox property tags channel


[Expand]
function RPiFramebufferTestOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Description: Test Framebuffer Overscan from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetPalette(Buffer:Pointer; Length:LongWord):LongWord;
Description: Get Framebuffer Palette from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Description: Set Framebuffer Palette from the Mailbox property tags channel


[Expand]
function RPiFramebufferTestPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Description: Test Framebuffer Palette from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetLayer(var Layer:LongInt):LongWord;
Description: Get Framebuffer Layer from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetLayer(var Layer:LongInt):LongWord;
Description: Set Framebuffer Layer from the Mailbox property tags channel


[Expand]
function RPiFramebufferTestLayer(var Layer:LongInt):LongWord;
Description: Test Framebuffer Layer from the Mailbox property tags channel


[Expand]
function RPiFramebufferTestVsync:LongWord;
Description: Test Framebuffer Vertical Sync from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetVsync:LongWord;
Description: Set Framebuffer Vertical Sync from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetBacklight(Brightness:LongWord):LongWord;
Description: Set Framebuffer Backlight Brightness from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetNumDisplays(var NumDisplays:LongWord):LongWord;
Description: Get the number of displays from the Mailbox property tags channel


[Expand]
function RPiFramebufferGetDisplayId(DisplayNum:LongWord):LongWord;
Description: Get the display id for the specified display number from the Mailbox property tags channel


[Expand]
function RPiFramebufferSetDisplayNum(DisplayNum:LongWord):LongWord;
Description: Get the display number that all framebuffer requests will refer to using the Mailbox property tags channel


[Expand]
function RPiFramebufferGetDisplaySettings(DisplayNum:LongWord; var DisplaySettings:TDisplaySettings):LongWord;
Description: Get the display settings for the specified display number from the Mailbox property tags channel


[Expand]
function RPiFramebufferDisplayIdToName(DisplayId:LongWord):String;
Description: Get the name for the specified display id


[Expand]
function RPiTouchGetBuffer(var Address:PtrUInt):LongWord;
Description: Get the Touchscreen buffer from the Mailbox property tags channel


[Expand]
function RPiTouchSetBuffer(Address:PtrUInt):LongWord;
Description: Set the Touchscreen buffer in the Mailbox property tags channel


[Expand]
function RPiCursorSetDefault:LongWord;
Description: Set Cursor Default (Pixels) from the Mailbox property tags channel


[Expand]
function RPiCursorSetInfo(Width,Height,HotspotX,HotspotY:LongWord; Pixels:Pointer; Length:LongWord):LongWord;
Description: Set Cursor Info (Pixels) from the Mailbox property tags channel


[Expand]
function RPiCursorSetState(Enabled:Boolean; X,Y:LongWord; Relative:Boolean):LongWord;
Description: Set Cursor State (Enable, X, Y) from the Mailbox property tags channel


[Expand]
function RPiDMAGetChannels:LongWord;
Description: Get the available DMA Channels from the Mailbox property tags channel


RPi thread functions

[Expand]
procedure RPiSchedulerInit;
Description: To be documented


RPi SWI functions

[Expand]
function RPiDispatchSWI(CPUID:LongWord; Thread:TThreadHandle; Request:PSystemCallRequest):TThreadHandle;
Description: Process an SWI request


RPi clock functions

[Expand]
procedure RPiClockInterrupt(Parameter:Pointer);
Description: Interrupt handler function for the clock interrupt


[Expand]
procedure RPiClockUpdate(Cycles:LongWord; var Last:LongWord);
Description: Setup a clock interrupt to trigger after the specified number of clock cycles


RPi scheduler functions

[Expand]
function RPiSchedulerInterrupt(CPUID:LongWord; Thread:TThreadHandle; Parameter:Pointer):TThreadHandle;
Description: Interrupt handler function for the scheduler interrupt


[Expand]
procedure RPiSchedulerUpdate(Cycles:LongWord; var Last:LongWord);
Description: Setup a scheduler interrupt to trigger after the specified number of clock cycles


[Expand]
procedure RPiSchedulerSystemCall(Request:PSystemCallRequest);
Description: System Call handler for the scheduler


RPi framebuffer functions

[Expand]
function RPiFramebufferDeviceAllocate(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Allocate a framebuffer using the Mailbox Property Tags


[Expand]
function RPiFramebufferDeviceAllocateAlt(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Allocate a framebuffer using a simple Mailbox Call


[Expand]
function RPiFramebufferDeviceRelease(Framebuffer:PFramebufferDevice):LongWord;
Description: To be documented


[Expand]
function RPiFramebufferDeviceBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Description: To be documented


[Expand]
function RPiFramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags:LongWord):LongWord;
Description: To be documented


[Expand]
function RPiFramebufferDeviceSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;
Description: To be documented


RPi helper functions

[Expand]
procedure RPiWait; assembler; nostackframe;
Description: To be documented


[Expand]
procedure RPiLongWait; assembler; nostackframe;
Description: To be documented


[Expand]
procedure RPiShortWait; assembler; nostackframe;
Description: To be documented


[Expand]
procedure RPiSlowBlink; assembler; nostackframe;
Description: To be documented


[Expand]
procedure RPiFastBlink; assembler; nostackframe;
Description: To be documented


[Expand]
procedure RPiBootBlink; assembler; nostackframe;
Description: Blink the Activity LED without dependency on any other RTL setup


[Expand]
procedure RPiBootOutput(Value:LongWord);
Description: Output characters to UART0 without dependency on any other RTL setup


[Expand]
procedure RPiBootConsoleStart;
Description: To be documented


[Expand]
procedure RPiBootConsoleWrite(const Value:String);
Description: To be documented


[Expand]
procedure RPiBootConsoleWriteEx(const Value:String; X,Y:LongWord);
Description: To be documented


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


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


[Expand]
function RPiConvertPowerIdRequest(PowerId:LongWord):LongWord;
Description: Convert Ultibo Power Id to BCM2835 Power Id


[Expand]
function RPiConvertPowerStateRequest(PowerState:LongWord):LongWord;
Description: Convert Ultibo Power State to BCM2835 Power State


[Expand]
function RPiConvertPowerStateResponse(PowerState:LongWord):LongWord;
Description: Convert BCM2835 Power State to Ultibo Power State


[Expand]
function RPiConvertClockIdRequest(ClockId:LongWord):LongWord;
Description: Convert Ultibo Clock Id to BCM2835 Clock Id


[Expand]
function RPiConvertClockStateRequest(ClockState:LongWord):LongWord;
Description: Convert Ultibo Clock State to BCM2835 Clock State


[Expand]
function RPiConvertClockStateResponse(ClockState:LongWord):LongWord;
Description: Convert BCM2835 Clock State to Ultibo Clock State


[Expand]
function RPiConvertVoltageIdRequest(VoltageId:LongWord):LongWord;
Description: Convert Ultibo Voltage Id to BCM2835 Voltage Id


[Expand]
function RPiConvertTemperatureIdRequest(TemperatureId:LongWord):LongWord;
Description: Convert Ultibo Temperature Id to BCM2835 Temperature Id


Return to Unit Reference