Difference between revisions of "Unit PlatformRPi3"

From Ultibo.org
Jump to: navigation, search
 
(36 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
The RPi3 B has the Activity LED connected to the GPU, access is via a Virtual GPIO (Power LED appears to be unavailable).
+
'''Ultibo Platform Interface unit for Raspberry Pi 3'''
 +
 
 +
The RPi3 B has the Activity LED connected to the GPU, access is via a Virtual GPIO (Power LED is only accessible via the GPIO expander driver).
 +
 
 +
The RPi3 B+ has the Activity LED connected to GPIO Pin 29 (Power LED is only accessible via the GPIO expander driver).
  
 
=== Constants ===
 
=== Constants ===
 
----
 
----
  
''To be documented''
+
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 ARM physical to VC IO mapping''' <code> RPI3_VCIO_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_VCIO_ALIAS = BCM2837_VCIO_ALIAS;</code>
 +
| The VCIO Alias (For ARM Physcial to VC IO translation)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 ARM physical to VC bus mapping''' <code> RPI3_VCBUS_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_VCBUS_ALIAS = BCM2837_VCBUS_C_ALIAS;</code>
 +
| The currently selected VCBUS Alias (For ARM Physcial to VC Bus translation)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 secure world boot''' <code> RPI3_SECURE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_SECURE_BOOT = $00000001;</code>
 +
| If 1 then startup will attempt to switch back to secure world during boot process (Moved to ARMSecureBoot)
 +
|-
 +
| <code>RPI3_SECURE_BOOT_OFFSET = $000000D4;</code>
 +
| The address of the Secure Boot marker in the ARM boot stub
 +
|-
 +
| <code>RPI3_SECURE_BOOT_MARKER = $58495052;</code>
 +
| The Secure Boot marker (ASCII "RPIX")
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 address of StartupHandler on reset''' <code> RPI3_STARTUP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_STARTUP_ADDRESS = $00008000;</code>
 +
| Address of StartupHandler on Reset (Obtain from linker)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 page table address and size''' <code> RPI3_PAGE_TABLE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_PAGE_TABLE_BASE = $00004000;</code>
 +
| Place the first level Page Table after the interrupt vectors at 0x00001000 and before the code start at 0x00008000
 +
|-
 +
| <code>RPI3_PAGE_TABLE_SIZE = SIZE_16K;</code>
 +
| ARM Cortex A7 first level Page Table is exactly 16KB in size (4096 32 bit (4 byte) entries)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 vector table address and size''' <code> RPI3_VECTOR_TABLE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_VECTOR_TABLE_BASE = $00001000;</code>
 +
| Place the Interrupt Vector Table at 0x00001000 before the code start at 0x00008000
 +
|-
 +
| <code>RPI3_VECTOR_TABLE_SIZE = SIZE_64;</code>
 +
| The Interrupt Vector Table is exactly 64 bytes (16 32 bit (4 byte) entries)
 +
|-
 +
| <code>RPI3_VECTOR_TABLE_COUNT = 8;</code>
 +
| The Interrupt Vector Table contains 8 entries on an ARMv7 device
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 CPU count''' <code> RPI3_CPU_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_CPU_COUNT = BCM2837_CPU_COUNT;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>RPI3_CPU_BOOT = CPU_ID_0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RPI3_CPU_MASK = CPU_AFFINITY_0 or CPU_AFFINITY_1 or CPU_AFFINITY_2 or CPU_AFFINITY_3;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 IRQ/FIQ start/routing''' <code> RPI3_IRQ_*, RPI3_FIQ_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_IRQ_START = 0;</code>
 +
| System wide IRQs start at zero
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>RPI3_IRQ_ROUTING = CPU_ID_0;</code>
 +
| Route system wide IRQs to CPU0
 +
|-
 +
| <code>RPI3_FIQ_ROUTING = CPU_ID_0;</code>
 +
| Route system wide FIQs to CPU0
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>RPI3_IRQ_LOCAL_START = BCM2837_GPU_IRQ_COUNT + BCM2837_ARM_IRQ_COUNT;</code>
 +
| Local IRQs start after GPU and ARM IRQs
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 SWI''' <code> RPI3_SWI_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_SWI_COUNT = 256;</code>
 +
| Number of available SWI entries
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 core timer prescaler''' <code> RPI3_*_TIMER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_CORE_TIMER_PRESCALER = $06AAAAAB;</code>
 +
| Divide the Crystal Clock by 19.2 to give a 1MHz Core Timer
 +
|-
 +
| <code>RPI3_CORE_TIMER_FREQUENCY = 1000000;</code>
 +
| The Core Timer frequency from the prescaler setting above
 +
|-
 +
| <code>RPI3_GENERIC_TIMER_FREQUENCY = 1000000;</code>
 +
| The ARM Generic Timer frequency from the prescaler setting above
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 kernel image name''' <code> RPI3_KERNEL_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_KERNEL_NAME = 'kernel7.img';</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>RPI3_KERNEL_NAME = 'kernel8.img';</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>RPI3_KERNEL_CONFIG = 'config.txt';</code>
 +
| &nbsp;
 +
|-
 +
| <code>RPI3_KERNEL_COMMAND = 'cmdline.txt';</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<code>RPI3_FIRMWARE_FILES = 'bootcode.bin,start.elf,fixup.dat,armstub32-rpi3.bin,armstub64-rpi3.bin';</code>
 +
|-
 +
|colspan="2"|<code>RPI3_DTB_FILES = 'bcm2710-rpi-2-b.dtb,bcm2710-rpi-3-b.dtb,bcm2710-rpi-3-b-plus.dtb,bcm2710-rpi-cm3.dtb,bcm2710-rpi-zero-2.dtb,bcm2710-rpi-zero-2-w.dtb';</code>
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 mailbox''' <code> RPI3_MAILBOX_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_MAILBOX_TIMEOUT = 100;</code>
 +
| Default timeout to wait for mailbox calls to complete (Milliseconds)
 +
|-
 +
| <code>RPI3_MAILBOX_TIMEOUT_EX = 1000;</code>
 +
| Extended timeout to wait for mailbox calls to complete (Milliseconds)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 local mailbox''' <code> RPI3_LOCAL_MAILBOX_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_LOCAL_MAILBOX_TIMEOUT = 100;</code>
 +
| Default timeout to wait for local mailbox calls to complete (Milliseconds)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPi3 framebuffer''' <code> RPI3_FRAMEBUFFER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPI3_FRAMEBUFFER_DESCRIPTION = 'BCM2837 Framebuffer';</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===
 
----
 
----
  
''To be documented''
+
''None defined''
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
  
''To be documented''
+
 
 +
'''RPi3 specific Ultibo variables'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>RPi3Initialized:Boolean;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>RPi3CNTVOFFLow:LongWord = 0;</code>
 +
| style="width: 40%;"|The low 32 bits of the Virtual Counter Offset register at boot time (CPU0 only) (Set by Startup). Must be initialized to remain in .data or else rewritten to zero with .bss
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>RPi3CNTVOFFHigh:LongWord = 0;</code>
 +
| style="width: 40%;"|The high 32 bits of the Virtual Counter Offset register at boot time (CPU0 only) (Set by Startup). Must be initialized to remain in .data or else rewritten to zero with .bss
 +
|-
 +
|}
 +
 
 +
'''Timer variables'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TimerRegisters:PBCM2837SystemTimerRegisters;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Mailbox variables'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>Mailbox0Registers:PBCM2837Mailbox0Registers;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>Mailbox1Registers:PBCM2837Mailbox1Registers;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Interrupt variables'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>InterruptRegisters:PBCM2837InterruptRegisters;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>InterruptEntries:array[0..(BCM2837_GPU_IRQ_COUNT + BCM2837_ARM_IRQ_COUNT - 1)] of PInterruptEntry;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>LocalInterruptEntries:array[RPI3_IRQ_LOCAL_START..(BCM2837_IRQ_COUNT - 1),0..(RPI3_CPU_COUNT - 1)] of PInterruptEntry;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''System call'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>SystemCallEntries:array[0..RPI3_SWI_COUNT - 1] of TSystemCallEntry;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''IRQ/FIQ'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>IRQEnabled:array[0..2] of LongWord;</code>
 +
| style="width: 40%;"|3 groups of IRQs to Enable/Disable (See: TBCM2837InterruptRegisters)
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>FIQEnabled:LongWord;</code>
 +
| style="width: 40%;"|The single IRQ number to Enable as FIQ instead (See: TBCM2837InterruptRegisters)
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>LocalIRQEnabled:array[0..(RPI3_CPU_COUNT - 1)] of LongWord;</code>
 +
| style="width: 40%;"|1 group of local IRQs to Enable/Disable per CPU (See: TBCM2837ARMLocalRegisters)
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>LocalFIQEnabled:array[0..(RPI3_CPU_COUNT - 1)] of LongWord;</code>
 +
| style="width: 40%;"|1 group of local FIQs to Enable/Disable per CPU (See: TBCM2837ARMLocalRegisters)
 +
|-
 +
|}
 +
 
 +
'''Watchdog variables'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>WatchdogRegisters:PBCM2837PMWatchdogRegisters;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''ARM local'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMLocalRegisters:PBCM2837ARMLocalRegisters;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Virtual GPIO'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>VirtualGPIOBuffer:TBCM2837VirtualGPIOBuffer;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
<br />
  
 
=== Function declarations ===
 
=== Function declarations ===
Line 34: Line 381:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 46: Line 393:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 58: Line 405:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 70: Line 417:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 85: Line 432:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 97: Line 444:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 109: Line 456:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 121: Line 468:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 133: Line 480:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 145: Line 492:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 157: Line 504:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 169: Line 516:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 181: Line 528:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 193: Line 540:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 205: Line 552:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 217: Line 564:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 229: Line 576:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 241: Line 588:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 253: Line 600:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 265: Line 612:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 277: Line 624:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Data = first 28 bits, Channel = last 4 bits
 
| Data = first 28 bits, Channel = last 4 bits
 
|-
 
|-
Line 289: Line 636:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Data = first 28 bits, Channel = last 4 bits
 
| Data = first 28 bits, Channel = last 4 bits
 
|-
 
|-
Line 301: Line 648:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| 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
Line 314: Line 661:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| 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
Line 327: Line 674:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| 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
Line 340: Line 687:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| 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
Line 348: Line 695:
 
<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 RPi3RequestExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi3MailboxPropertyTag(Tag:LongWord; Data:Pointer; Size:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Request registration of the supplied handler to the specified IRQ number</div>
+
<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;">
 
<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'''
+
! Data
| CPU to route IRQ to
+
| Data does not need to include mailbox property channel header or footer. Data pointer does not need any specific alignment or caching attributes.
 
|-
 
|-
! '''Number'''
+
! Size
| IRQ number to register
+
| Size must be a multiple of 4 bytes. Size must include the size of the request and response which use the same buffer.
 
|-
 
|-
! '''Handler'''
+
|}
| Interrupt handler function to register
+
</div></div>
|-
+
<br />
! '''HandlerEx'''
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
| Extended Interrupt handler function to register
+
<pre style="border: 0; padding-bottom:0px;">function RPi3RequestExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Request registration of the supplied handler to the specified IRQ number</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
+
| Non documented
 
|-
 
|-
 
|}
 
|}
Line 377: Line 727:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''CPUID'''
+
! Note
| CPU to route IRQ to
+
| Non documented
|-
+
! '''Number'''
+
| IRQ number to deregister
+
|-
+
! '''Handler'''
+
| Interrupt handler function to deregister
+
|-
+
! '''HandlerEx'''
+
| Extended Interrupt handler function to deregister
+
|-
+
! '''Note'''
+
| Only one of Handler or HandlerEx can be specified
+
 
|-
 
|-
 
|}
 
|}
Line 401: Line 739:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''CPUID'''
+
! Note
| CPU to route FIQ to
+
| Non documented
|-
+
! '''Number'''
+
| FIQ number to register
+
|-
+
! '''Handler'''
+
| Interrupt handler function to register
+
|-
+
! '''HandlerEx'''
+
| Extended Interrupt handler function to register
+
|-
+
! '''Note'''
+
| Only one of Handler or HandlerEx can be specified
+
 
|-
 
|-
 
|}
 
|}
Line 425: Line 751:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''CPUID'''
+
! Note
| CPU to route FIQ to
+
| Non 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 RPi3RegisterInterrupt(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 RPi3DeregisterInterrupt(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 449: Line 787:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''CPUID'''
+
! Note
| The CPU ID to register the System Call against (or CPU_ID_ALL)
+
| Non documented
|-
+
! '''Number'''
+
| The System Call number to be registered
+
|-
+
! '''Handler'''
+
| The handler function to be registered
+
|-
+
! '''HandlerEx'''
+
| The extended handler function to be registered
+
|-
+
! '''Note'''
+
| Only one of Handler or HandlerEx can be specified
+
 
|-
 
|-
 
|}
 
|}
Line 473: Line 799:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''CPUID'''
+
! Note
| The CPU ID to deregister the System Call from (or CPU_ID_ALL)
+
| None documented
|-
+
! '''Number'''
+
| The System Call number to be deregistered
+
|-
+
! '''Handler'''
+
| The handler function to be deregistered
+
|-
+
! '''HandlerEx'''
+
| The extended handler function to be deregistered
+
|-
+
! '''Note'''
+
| Only one of Handler or HandlerEx can be specified
+
 
|-
 
|-
 
|}
 
|}
Line 492: Line 806:
 
<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 RPi3GetInterruptEntry(Number:LongWord):TInterruptEntry;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi3GetInterruptEntry(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;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 503: Line 817:
 
</div></div>
 
</div></div>
 
<br />
 
<br />
 
function RPi3GetLocalInterruptEntry(CPUID,Number:LongWord):TInterruptEntry;
 
{Get the local interrupt entry for the specified interrupt number}
 
 
 
<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</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi3GetLocalInterruptEntry(CPUID,Number,Instance:LongWord; var Interrupt:TInterruptEntry):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the local 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;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 525: Line 835:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 537: Line 847:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 549: Line 859:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 561: Line 871:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 568: Line 878:
 
<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 RPi3CPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi3CPUGetMemory(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;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 585: Line 895:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 592: Line 902:
 
<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 RPi3GPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi3GPUGetMemory(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;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 609: Line 919:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 621: Line 931:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 633: Line 943:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 645: Line 955:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 657: Line 967:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! 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 RPi3FirmwareGetThrottled: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;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 669: Line 991:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 681: Line 1,003:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 693: Line 1,015:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Power Lock not required due to Mailbox Property Call serialization
 
| Power Lock not required due to Mailbox Property Call serialization
 
|-
 
|-
Line 705: Line 1,027:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| On the Raspberry Pi this comes from the System Timer free running counter which runs at 1MHz and therefore overflows every 4295 seconds
 
| On the Raspberry Pi this comes from the System Timer free running counter which runs at 1MHz and therefore overflows every 4295 seconds
 
|-
 
|-
Line 717: Line 1,039:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| On the Raspberry Pi this comes from the System Timer free running counter which runs at 1MHz, the clock interrupt also uses this timer to increment the clock every second and therefore keep time.
 
| On the Raspberry Pi this comes from the System Timer free running counter which runs at 1MHz, the clock interrupt also uses this timer to increment the clock every second and therefore keep time.
 
|-
 
|-
Line 729: Line 1,051:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 741: Line 1,063:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 753: Line 1,075:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 765: Line 1,087:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 777: Line 1,099:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 789: Line 1,111:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 801: Line 1,123:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 813: Line 1,135:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 825: Line 1,147:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 837: Line 1,159:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 849: Line 1,171:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 861: Line 1,183:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 873: Line 1,195:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 885: Line 1,207:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 897: Line 1,219:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 909: Line 1,231:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 921: Line 1,243:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 933: Line 1,255:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 945: Line 1,267:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 957: Line 1,279:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 969: Line 1,291:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 981: Line 1,303:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 993: Line 1,315:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,005: Line 1,327:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,017: Line 1,339:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,029: Line 1,351:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,041: Line 1,363:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,053: Line 1,375:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,065: Line 1,387:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,077: Line 1,399:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,089: Line 1,411:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,101: Line 1,423:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,113: Line 1,435:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,125: Line 1,447:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,137: Line 1,459:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,149: Line 1,471:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,161: Line 1,483:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,173: Line 1,495:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,185: Line 1,507:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,197: Line 1,519:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,209: Line 1,531:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,221: Line 1,543:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,233: Line 1,555:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,245: Line 1,567:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,257: Line 1,579:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,269: Line 1,591:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,281: Line 1,603:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,293: Line 1,615:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,305: Line 1,627:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,317: Line 1,639:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! 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 RPi3FramebufferGetLayer(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 RPi3FramebufferSetLayer(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 RPi3FramebufferTestLayer(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;">
 +
{| 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 RPi3FramebufferTestVsync:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Test Framebuffer Vertical Sync 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 RPi3FramebufferSetVsync:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Framebuffer Vertical Sync 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
 
| None documented
 
|-
 
|-
Line 1,329: Line 1,711:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,336: Line 1,718:
 
<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 RPi3TouchGetBuffer(var Address:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi3FramebufferGetNumDisplays(var NumDisplays:LongWord):LongWord;</pre>
 +
<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;">
 +
{| 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 RPi3FramebufferGetDisplayId(DisplayNum:LongWord):LongWord;</pre>
 +
<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;">
 +
{| 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 RPi3FramebufferSetDisplayNum(DisplayNum:LongWord):LongWord;</pre>
 +
<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;">
 +
{| 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 RPi3FramebufferGetDisplaySettings(DisplayNum:LongWord; var DisplaySettings:TDisplaySettings):LongWord;</pre>
 +
<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;">
 +
{| 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 RPi3FramebufferDisplayIdToName(DisplayId:LongWord):String;</pre>
 +
<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;">
 +
{| 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 RPi3TouchGetBuffer(var Address:PtrUInt):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 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;"
 
|-
 
|-
! '''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.
 +
|-
 +
|}
 +
</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 RPi3TouchSetBuffer(Address:PtrUInt):LongWord;</pre>
 +
<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;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,348: Line 1,802:
 
<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 RPi3VirtualGPIOGetBuffer(var Address:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi3VirtualGPIOGetBuffer(var Address:PtrUInt):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Virtual GPIO buffer from the Mailbox property tags channel</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Virtual GPIO 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;"
 
|-
 
|-
! '''Note'''
+
! 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 RPi3VirtualGPIOSetBuffer(Address:PtrUInt):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the Virtual GPIO buffer in 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 RPi3CursorSetDefault:LongWord;</pre>
 +
<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;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,365: Line 1,843:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,377: Line 1,855:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Relative'''
+
! Relative
| X, Y is relative to Display (Virtual) not Framebuffer (Physical)
+
| X, Y is relative to Display (Virtual) not Framebuffer (Physical).
 
|-
 
|-
 
|}
 
|}
Line 1,389: Line 1,867:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! 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 RPi3VirtualGPIOAllocate:Boolean;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate the Virtual GPIO buffer either from memory or from the firmware</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,401: Line 1,891:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,413: Line 1,903:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,425: Line 1,915:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,440: Line 1,930:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,452: Line 1,942:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,464: Line 1,954:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 
 +
'''RPi3 SWI 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 RPi3DispatchSWI(CPUID:LongWord; Thread:TThreadHandle; Request:PSystemCallRequest):TThreadHandle;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Process an SWI request</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Called by ARMv8SoftwareInterruptHandler in PlatformARMv8
 +
A DataMemoryBarrier is executed before and after calling this function
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 
 +
'''RPi3 clock 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;">procedure RPi3ClockInterrupt(Parameter:Pointer);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Interrupt handler function for the clock interrupt</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| This schedules another clock interrupt to occur CLOCK_CYCLES_PER_TICK in the future, then updates ClockTicks and ClockSeconds and checks for timers to trigger.
 +
|-
 +
|}
 +
</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 RPi3ClockUpdate(Cycles:LongWord; var Last:LongWord);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Setup a clock interrupt to trigger after the specified number of clock cycles</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Cycles
 +
| Number of cycles after which the timer interrupt is to be triggered
 +
|-
 +
! Note
 +
| This refers to native clock cycles as specified by CLOCK_FREQUENCY
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 
 +
'''RPi3 scheduler 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 RPi3SchedulerInterrupt(CPUID:LongWord; Thread:TThreadHandle; Parameter:Pointer):TThreadHandle;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Interrupt handler function for the scheduler interrupt</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| This schedules another scheduler interrupt to occur SCHEDULER_CLOCKS_PER_INTERRUPT in the future, then checks for threads to wakeup or timeout and the next thread to schedule.
 +
|-
 +
|}
 +
</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 RPi3SchedulerUpdate(Cycles:LongWord; var Last:LongWord);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Setup a scheduler interrupt to trigger after the specified number of clock cycles</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Cycles
 +
| Number of cycles after which the scheduler interrupt is to be triggered
 +
|-
 +
! Note
 +
| This refers to native clock cycles as specified by RPI3_GENERIC_TIMER_FREQUENCY
 +
|-
 +
|}
 +
</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 RPi3SchedulerSystemCall(Request:PSystemCallRequest);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' System Call handler for the scheduler</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| This is registered to receive requests for the SYSTEM_CALL_CONTEXT_SWITCH and will perform a context switch from within an SWI
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 
 +
'''RPi3 framebuffer 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 RPi3FramebufferDeviceAllocate(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a framebuffer using the Mailbox Property Tags</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 RPi3FramebufferDeviceAllocateAlt(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a framebuffer using a simple Mailbox Call</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 RPi3FramebufferDeviceRelease(Framebuffer:PFramebufferDevice):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 RPi3FramebufferDeviceBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):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 RPi3FramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags: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 RPi3FramebufferDeviceSetBacklight(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 />
 +
 
 +
'''RPi3 helper 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;">procedure RPi3Wait; assembler; nostackframe;</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 RPi3LongWait; assembler; nostackframe;</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 RPi3ShortWait; assembler; nostackframe;</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 RPi3SlowBlink; assembler; nostackframe;</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 RPi3FastBlink; assembler; nostackframe;</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 RPi3BootBlink; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Blink the Activity LED 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
 +
| 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 RPi3BootOutput(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 RPi3BootConsoleStart;</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 RPi3BootConsoleWrite(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 RPi3BootConsoleWriteEx(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 RPi3BootConsoleGetX: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 RPi3BootConsoleGetY: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 RPi3ConvertPowerIdRequest(PowerId:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert Ultibo Power Id to BCM2837 Power Id</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 RPi3ConvertPowerStateRequest(PowerState:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert Ultibo Power State to BCM2837 Power State</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 RPi3ConvertPowerStateResponse(PowerState:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert BCM2837 Power State to Ultibo Power State</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 RPi3ConvertClockIdRequest(ClockId:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert Ultibo Clock Id to BCM2837 Clock Id</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 RPi3ConvertClockStateRequest(ClockState:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert Ultibo Clock State to BCM2837 Clock State</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 RPi3ConvertClockStateResponse(ClockState:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert BCM2837 Clock State to Ultibo Clock State</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 RPi3ConvertVoltageIdRequest(VoltageId:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert Ultibo Voltage Id to BCM2837 Voltage Id</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 RPi3ConvertTemperatureIdRequest(TemperatureId:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert Ultibo Temperature Id to BCM2837 Temperature Id</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 
| None documented
 
| None documented
 
|-
 
|-

Latest revision as of 05:09, 23 November 2022

Return to Unit Reference


Description


Ultibo Platform Interface unit for Raspberry Pi 3

The RPi3 B has the Activity LED connected to the GPU, access is via a Virtual GPIO (Power LED is only accessible via the GPIO expander driver).

The RPi3 B+ has the Activity LED connected to GPIO Pin 29 (Power LED is only accessible via the GPIO expander driver).

Constants



RPi3 ARM physical to VC IO mapping RPI3_VCIO_*
RPI3_VCIO_ALIAS = BCM2837_VCIO_ALIAS; The VCIO Alias (For ARM Physcial to VC IO translation)


RPi3 ARM physical to VC bus mapping RPI3_VCBUS_*
RPI3_VCBUS_ALIAS = BCM2837_VCBUS_C_ALIAS; The currently selected VCBUS Alias (For ARM Physcial to VC Bus translation)


RPi3 secure world boot RPI3_SECURE_*
RPI3_SECURE_BOOT = $00000001; If 1 then startup will attempt to switch back to secure world during boot process (Moved to ARMSecureBoot)
RPI3_SECURE_BOOT_OFFSET = $000000D4; The address of the Secure Boot marker in the ARM boot stub
RPI3_SECURE_BOOT_MARKER = $58495052; The Secure Boot marker (ASCII "RPIX")


RPi3 address of StartupHandler on reset RPI3_STARTUP_*
RPI3_STARTUP_ADDRESS = $00008000; Address of StartupHandler on Reset (Obtain from linker)


RPi3 page table address and size RPI3_PAGE_TABLE_*
RPI3_PAGE_TABLE_BASE = $00004000; Place the first level Page Table after the interrupt vectors at 0x00001000 and before the code start at 0x00008000
RPI3_PAGE_TABLE_SIZE = SIZE_16K; ARM Cortex A7 first level Page Table is exactly 16KB in size (4096 32 bit (4 byte) entries)


RPi3 vector table address and size RPI3_VECTOR_TABLE_*
RPI3_VECTOR_TABLE_BASE = $00001000; Place the Interrupt Vector Table at 0x00001000 before the code start at 0x00008000
RPI3_VECTOR_TABLE_SIZE = SIZE_64; The Interrupt Vector Table is exactly 64 bytes (16 32 bit (4 byte) entries)
RPI3_VECTOR_TABLE_COUNT = 8; The Interrupt Vector Table contains 8 entries on an ARMv7 device


RPi3 CPU count RPI3_CPU_*
RPI3_CPU_COUNT = BCM2837_CPU_COUNT;  
RPI3_CPU_BOOT = CPU_ID_0;  
RPI3_CPU_MASK = CPU_AFFINITY_0 or CPU_AFFINITY_1 or CPU_AFFINITY_2 or CPU_AFFINITY_3;  


RPi3 IRQ/FIQ start/routing RPI3_IRQ_*, RPI3_FIQ_*
RPI3_IRQ_START = 0; System wide IRQs start at zero
 
RPI3_IRQ_ROUTING = CPU_ID_0; Route system wide IRQs to CPU0
RPI3_FIQ_ROUTING = CPU_ID_0; Route system wide FIQs to CPU0
 
RPI3_IRQ_LOCAL_START = BCM2837_GPU_IRQ_COUNT + BCM2837_ARM_IRQ_COUNT; Local IRQs start after GPU and ARM IRQs


RPi3 SWI RPI3_SWI_*
RPI3_SWI_COUNT = 256; Number of available SWI entries


RPi3 core timer prescaler RPI3_*_TIMER_*
RPI3_CORE_TIMER_PRESCALER = $06AAAAAB; Divide the Crystal Clock by 19.2 to give a 1MHz Core Timer
RPI3_CORE_TIMER_FREQUENCY = 1000000; The Core Timer frequency from the prescaler setting above
RPI3_GENERIC_TIMER_FREQUENCY = 1000000; The ARM Generic Timer frequency from the prescaler setting above


RPi3 kernel image name RPI3_KERNEL_*
RPI3_KERNEL_NAME = 'kernel7.img';  
 
RPI3_KERNEL_NAME = 'kernel8.img';  
 
RPI3_KERNEL_CONFIG = 'config.txt';  
RPI3_KERNEL_COMMAND = 'cmdline.txt';  
RPI3_FIRMWARE_FILES = 'bootcode.bin,start.elf,fixup.dat,armstub32-rpi3.bin,armstub64-rpi3.bin';
RPI3_DTB_FILES = 'bcm2710-rpi-2-b.dtb,bcm2710-rpi-3-b.dtb,bcm2710-rpi-3-b-plus.dtb,bcm2710-rpi-cm3.dtb,bcm2710-rpi-zero-2.dtb,bcm2710-rpi-zero-2-w.dtb';


RPi3 mailbox RPI3_MAILBOX_*
RPI3_MAILBOX_TIMEOUT = 100; Default timeout to wait for mailbox calls to complete (Milliseconds)
RPI3_MAILBOX_TIMEOUT_EX = 1000; Extended timeout to wait for mailbox calls to complete (Milliseconds)


RPi3 local mailbox RPI3_LOCAL_MAILBOX_*
RPI3_LOCAL_MAILBOX_TIMEOUT = 100; Default timeout to wait for local mailbox calls to complete (Milliseconds)


RPi3 framebuffer RPI3_FRAMEBUFFER_*
RPI3_FRAMEBUFFER_DESCRIPTION = 'BCM2837 Framebuffer';  


Type definitions


None defined

Public variables



RPi3 specific Ultibo variables

RPi3Initialized:Boolean;
RPi3CNTVOFFLow:LongWord = 0; The low 32 bits of the Virtual Counter Offset register at boot time (CPU0 only) (Set by Startup). Must be initialized to remain in .data or else rewritten to zero with .bss
RPi3CNTVOFFHigh:LongWord = 0; The high 32 bits of the Virtual Counter Offset register at boot time (CPU0 only) (Set by Startup). Must be initialized to remain in .data or else rewritten to zero with .bss

Timer variables

TimerRegisters:PBCM2837SystemTimerRegisters;

Mailbox variables

Mailbox0Registers:PBCM2837Mailbox0Registers;
Mailbox1Registers:PBCM2837Mailbox1Registers;

Interrupt variables

InterruptRegisters:PBCM2837InterruptRegisters;
InterruptEntries:array[0..(BCM2837_GPU_IRQ_COUNT + BCM2837_ARM_IRQ_COUNT - 1)] of PInterruptEntry;
LocalInterruptEntries:array[RPI3_IRQ_LOCAL_START..(BCM2837_IRQ_COUNT - 1),0..(RPI3_CPU_COUNT - 1)] of PInterruptEntry;

System call

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

IRQ/FIQ

IRQEnabled:array[0..2] of LongWord; 3 groups of IRQs to Enable/Disable (See: TBCM2837InterruptRegisters)
FIQEnabled:LongWord; The single IRQ number to Enable as FIQ instead (See: TBCM2837InterruptRegisters)
LocalIRQEnabled:array[0..(RPI3_CPU_COUNT - 1)] of LongWord; 1 group of local IRQs to Enable/Disable per CPU (See: TBCM2837ARMLocalRegisters)
LocalFIQEnabled:array[0..(RPI3_CPU_COUNT - 1)] of LongWord; 1 group of local FIQs to Enable/Disable per CPU (See: TBCM2837ARMLocalRegisters)

Watchdog variables

WatchdogRegisters:PBCM2837PMWatchdogRegisters;

ARM local

ARMLocalRegisters:PBCM2837ARMLocalRegisters;

Virtual GPIO

VirtualGPIOBuffer:TBCM2837VirtualGPIOBuffer;


Function declarations



Initialization functions

procedure RPi3Init;
Description: To be documented
Note None documented


procedure RPi3SecondarySwitch; assembler; nostackframe;
Description: Secondary CPU switch from HYP mode handler
Note None documented


procedure RPi3SecondarySecure; assembler; nostackframe;
Description: Secondary CPU switch to secure mode handler
Note None documented


procedure RPi3SecondaryHandler; assembler; nostackframe;
Description: Secondary CPU startup handler routine
Note None documented


RPi3 platform functions

procedure RPi3SMPInit;
Description: To be documented
Note None documented


procedure RPi3BoardInit;
Description: To be documented
Note None documented


procedure RPi3MemoryInit;
Description: To be documented
Note None documented


procedure RPi3ClockInit;
Description: To be documented
Note None documented


procedure RPi3PowerInit;
Description: To be documented
Note None documented


procedure RPi3MailboxInit;
Description: To be documented
Note None documented


procedure RPi3InterruptInit;
Description: To be documented
Note None documented


procedure RPi3PeripheralInit;
Description: To be documented
Note None documented


procedure RPi3FramebufferInit;
Description: To be documented
Note None documented


procedure RPi3PageTableInit;
Description: Initialize the Hardware Page Tables before enabling the MMU
Note None documented


procedure RPi3PowerLEDEnable;
Description: To be documented
Note None documented


procedure RPi3PowerLEDOn;
Description: To be documented
Note None documented


procedure RPi3PowerLEDOff;
Description: To be documented
Note None documented


procedure RPi3ActivityLEDEnable;
Description: To be documented
Note None documented


procedure RPi3ActivityLEDOn;
Description: To be documented
Note None documented


procedure RPi3ActivityLEDOff;
Description: To be documented
Note None documented


function RPi3MailboxReceive(Mailbox,Channel:LongWord):LongWord;
Description: Receive from specified mailbox on specified channel
Note Data = first 28 bits, Channel = last 4 bits


procedure RPi3MailboxSend(Mailbox,Channel,Data:LongWord);
Description: Send to specified mailbox on specified channel
Note Data = first 28 bits, Channel = last 4 bits


function RPi3MailboxCall(Mailbox,Channel,Data:LongWord; var Response:LongWord):LongWord;
Description: Perform a transaction (Send/Receive) to specified mailbox on specified channel
Note Data = first 28 bits, Channel = last 4 bits

Data pointer must be 16 byte aligned to allow for the 4 bit channel number


function RPi3MailboxCallEx(Mailbox,Channel,Data:LongWord; var Response:LongWord; Timeout:LongWord):LongWord;
Description: Perform a transaction (Send/Receive) to specified mailbox on specified channel
Note Data = first 28 bits, Channel = last 4 bits

Data pointer must be 16 byte aligned to allow for the 4 bit channel number


function RPi3MailboxPropertyCall(Mailbox,Channel:LongWord; Data:Pointer; var Response:LongWord):LongWord;
Description: Perform a property tag transaction (Send/Receive) to specified mailbox on specified channel
Note Data = first 28 bits, Channel = last 4 bits

Data pointer must be 16 byte aligned to allow for the 4 bit channel number


function RPi3MailboxPropertyCallEx(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
Note Data = first 28 bits, Channel = last 4 bits

Data pointer must be 16 byte aligned to allow for the 4 bit channel number


function RPi3MailboxPropertyTag(Tag:LongWord; Data:Pointer; Size:LongWord):LongWord;
Description: Request a property tag (Get/Set) from the mailbox property channel
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.


function RPi3RequestExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request registration of the supplied handler to the specified IRQ number
Note Non documented


function RPi3ReleaseExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request deregistration of the supplied handler from the specified IRQ number
Note Non documented


function RPi3RequestExFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request registration of the supplied handler to the specified FIQ number
Note Non documented


function RPi3ReleaseExFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request deregistration of the supplied handler from the specified FIQ number
Note Non documented


function RPi3RegisterInterrupt(Number,Mask,Priority,Flags:LongWord; Handler:TSharedInterruptHandler; Parameter:Pointer):LongWord;
Description: Request registration of the supplied handler to the specified interrupt number (Where Applicable)
Note None documented


function RPi3DeregisterInterrupt(Number,Mask,Priority,Flags:LongWord; Handler:TSharedInterruptHandler; Parameter:Pointer):LongWord;
Description: Request deregistration of the supplied handler from the specified interrupt number (Where Applicable)
Note None documented


function RPi3RegisterSystemCallEx(CPUID,Number:LongWord; Handler:TSystemCallHandler; HandlerEx:TSystemCallExHandler):LongWord;
Description: Request registration of the supplied extended handler to the specified System Call number
Note Non documented


function RPi3DeregisterSystemCallEx(CPUID,Number:LongWord; Handler:TSystemCallHandler; HandlerEx:TSystemCallExHandler):LongWord;
Description: Request deregistration of the supplied extended handler from the specified System Call number
Note None documented


function RPi3GetInterruptEntry(Number,Instance:LongWord; var Interrupt:TInterruptEntry):LongWord;
Description: Get the interrupt entry for the specified interrupt number and instance
Note None documented


function RPi3GetLocalInterruptEntry(CPUID,Number,Instance:LongWord; var Interrupt:TInterruptEntry):LongWord;
Description: Get the local interrupt entry for the specified interrupt number and instance
Note None documented


function RPi3GetSystemCallEntry(Number:LongWord):TSystemCallEntry;
Description: Get the system call entry for the specified system call number
Note None documented


function RPi3SystemRestart(Delay:LongWord):LongWord;
Description: To be documented
Note None documented


function RPi3SystemShutdown(Delay:LongWord):LongWord;
Description: To be documented
Note None documented


function RPi3SystemGetCommandLine:String;
Description: Get the Command Line from the Mailbox property tags channel
Note None documented


function RPi3CPUGetMemory(var Address:PtrUInt; var Length:UInt64):LongWord;
Description: Get the CPU Memory from the Mailbox property tags channel
Note None documented


function RPi3GPUGetState:LongWord;
Description: To be documented
Note None documented


function RPi3GPUGetMemory(var Address:PtrUInt; var Length:UInt64):LongWord;
Description: Get the GPU Memory from the Mailbox property tags channel
Note None documented


function RPi3BoardGetModel:LongWord;
Description: Get the Board Model from the Mailbox property tags channel
Note None documented


function RPi3BoardGetSerial:Int64;
Description: Get the Board Serial from the Mailbox property tags channel
Note None documented


function RPi3BoardGetRevision:LongWord;
Description: Get the Board Revision from the Mailbox property tags channel
Note None documented


function RPi3BoardGetMACAddress:String;
Description: Get the Board MAC Address from the Mailbox property tags channel
Note None documented


function RPi3FirmwareGetRevision:LongWord;
Description: Get the Firmware Revision from the Mailbox property tags channel
Note None documented


function RPi3FirmwareGetThrottled:LongWord;
Description: Get the Firmware Throttling state from the Mailbox property tags channel
Note None documented


function RPi3PowerGetWait(PowerId:LongWord):LongWord;
Description: Get the Power Wait from the Mailbox property tags channel
Note None documented


function RPi3PowerGetState(PowerId:LongWord):LongWord;
Description: Get the Power State from the Mailbox property tags channel
Note None documented


function RPi3PowerSetState(PowerId,State:LongWord; Wait:Boolean):LongWord;
Description: Set the Power State in the Mailbox property tags channel
Note Power Lock not required due to Mailbox Property Call serialization


function RPi3ClockGetCount:LongWord;
Description: Gets the current system clock count (32 least significant bits of total)
Note On the Raspberry Pi this comes from the System Timer free running counter which runs at 1MHz and therefore overflows every 4295 seconds


function RPi3ClockGetTotal:Int64;
Description: Gets the total system clock count
Note On the Raspberry Pi this comes from the System Timer free running counter which runs at 1MHz, the clock interrupt also uses this timer to increment the clock every second and therefore keep time.


function RPi3ClockGetRate(ClockId:LongWord):LongWord;
Description: Get the Clock Rate from the Mailbox property tags channel
Note None documented


function RPi3ClockSetRate(ClockId,Rate:LongWord; Turbo:Boolean):LongWord;
Description: Set the Clock Rate in the Mailbox property tags channel
Note None documented


function RPi3ClockGetState(ClockId:LongWord):LongWord;
Description: Get the Clock State from the Mailbox property tags channel
Note None documented


function RPi3ClockSetState(ClockId,State:LongWord):LongWord;
Description: Set the Clock State in the Mailbox property tags channel
Note None documented


function RPi3ClockGetMinRate(ClockId:LongWord):LongWord;
Description: Get the Clock Min Rate from the Mailbox property tags channel
Note None documented


function RPi3ClockGetMaxRate(ClockId:LongWord):LongWord;
Description: Get the Clock Max Rate from the Mailbox property tags channel
Note None documented


function RPi3TurboGetState(TurboId:LongWord):LongWord;
Description: Get the Turbo State from the Mailbox property tags channel
Note None documented


function RPi3TurboSetState(TurboId,State:LongWord):LongWord;
Description: Set the Turbo State in the Mailbox property tags channel
Note None documented


function RPi3VoltageGetValue(VoltageId:LongWord):LongWord;
Description: Get the Voltage Value from the Mailbox property tags channel
Note None documented


function RPi3VoltageSetValue(VoltageId,Value:LongWord):LongWord;
Description: Set the Voltage Value in the Mailbox property tags channel
Note None documented


function RPi3VoltageGetMinValue(VoltageId:LongWord):LongWord;
Description: Get the Voltage Min Value from the Mailbox property tags channel
Note None documented


function RPi3VoltageGetMaxValue(VoltageId:LongWord):LongWord;
Description: Get the Voltage Max Value from the Mailbox property tags channel
Note None documented


function RPi3TemperatureGetCurrent(TemperatureId:LongWord):LongWord;
Description: Get the Temperature Current from the Mailbox property tags channel
Note None documented


function RPi3TemperatureGetMaximum(TemperatureId:LongWord):LongWord;
Description: Get the Temperature Maximum Model from the Mailbox property tags channel
Note None documented


function RPi3GPUMemoryAllocate(Length,Alignment,Flags:LongWord):THandle;
Description: Allocate GPU Memory from the Mailbox property tags channel
Note None documented


function RPi3GPUMemoryRelease(Handle:THandle):LongWord;
Description: Release GPU Memory from the Mailbox property tags channel
Note None documented


function RPi3GPUMemoryLock(Handle:THandle):LongWord;
Description: Lock GPU Memory from the Mailbox property tags channel
Note None documented


function RPi3GPUMemoryUnlock(Handle:THandle):LongWord;
Description: Unlock GPU Memory from the Mailbox property tags channel
Note None documented


function RPi3GPUExecuteCode(Address:Pointer; R0,R1,R2,R3,R4,R5:LongWord):LongWord;
Description: Execute GPU Code from the Mailbox property tags channel
Note None documented


function RPi3DispmanxHandleGet(Resource:THandle):THandle;
Description: Get Dispmanx Memory Handle from the Mailbox property tags channel
Note None documented


function RPi3EDIDBlockGet(Block:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Description: Get EDID Block from the Mailbox property tags channel
Note None documented


function RPi3FramebufferAllocate(Alignment:LongWord; var Address,Length:LongWord):LongWord;
Description: Allocate Framebuffer from the Mailbox property tags channel
Note None documented


function RPi3FramebufferRelease:LongWord;
Description: Release Framebuffer from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetState(State:LongWord):LongWord;
Description: Set Framebuffer State (Blank Screen) from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetDimensions(var Width,Height,Top,Bottom,Left,Right:LongWord):LongWord;
Description: Get Framebuffer Dimensions from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetPhysical(var Width,Height:LongWord):LongWord;
Description: Get Framebuffer Physical size from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetPhysical(var Width,Height:LongWord):LongWord;
Description: Set Framebuffer Physical size from the Mailbox property tags channel
Note None documented


function RPi3FramebufferTestPhysical(var Width,Height:LongWord):LongWord;
Description: Test Framebuffer Physical size from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetVirtual(var Width,Height:LongWord):LongWord;
Description: Get Framebuffer Virtual size from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetVirtual(var Width,Height:LongWord):LongWord;
Description: Set Framebuffer Virtual size from the Mailbox property tags channel
Note None documented


function RPi3FramebufferTestVirtual(var Width,Height:LongWord):LongWord;
Description: Test Framebuffer Virtual size from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetDepth(var Depth:LongWord):LongWord;
Description: Get Framebuffer Depth (Bits per pixel) from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetDepth(var Depth:LongWord):LongWord;
Description: Set Framebuffer Depth (Bits per pixel) from the Mailbox property tags channel
Note None documented


function RPi3FramebufferTestDepth(var Depth:LongWord):LongWord;
Description: Test Framebuffer Depth (Bits per pixel) from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetPixelOrder(var Order:LongWord):LongWord;
Description: Get Framebuffer Pixel Order (RGB) from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetPixelOrder(var Order:LongWord):LongWord;
Description: Set Framebuffer Pixel Order (RGB) from the Mailbox property tags channel
Note None documented


function RPi3FramebufferTestPixelOrder(var Order:LongWord):LongWord;
Description: Test Framebuffer Pixel Order (RGB) from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetAlphaMode(var Mode:LongWord):LongWord;
Description: Get Framebuffer Alpha Mode from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetAlphaMode(var Mode:LongWord):LongWord;
Description: Set Framebuffer Alpha Mode from the Mailbox property tags channel
Note None documented


function RPi3FramebufferTestAlphaMode(var Mode:LongWord):LongWord;
Description: Test Framebuffer Alpha Mode from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetPitch:LongWord;
Description: Get Framebuffer Pitch (Bytes per line) from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetOffset(var X,Y:LongWord):LongWord;
Description: Get Framebuffer Virtual Offset from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetOffset(var X,Y:LongWord):LongWord;
Description: Set Framebuffer Virtual Offset from the Mailbox property tags channel
Note None documented


function RPi3FramebufferTestOffset(var X,Y:LongWord):LongWord;
Description: Test Framebuffer Virtual Offset from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Description: Get Framebuffer Overscan from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Description: Set Framebuffer Overscan from the Mailbox property tags channel
Note None documented


function RPi3FramebufferTestOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Description: Test Framebuffer Overscan from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetPalette(Buffer:Pointer; Length:LongWord):LongWord;
Description: Get Framebuffer Palette from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Description: Set Framebuffer Palette from the Mailbox property tags channel
Note None documented


function RPi3FramebufferTestPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Description: Test Framebuffer Palette from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetLayer(var Layer:LongInt):LongWord;
Description: Get Framebuffer Layer from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetLayer(var Layer:LongInt):LongWord;
Description: Set Framebuffer Layer from the Mailbox property tags channel
Note None documented


function RPi3FramebufferTestLayer(var Layer:LongInt):LongWord;
Description: Test Framebuffer Layer from the Mailbox property tags channel
Note None documented


function RPi3FramebufferTestVsync:LongWord;
Description: Test Framebuffer Vertical Sync from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetVsync:LongWord;
Description: Set Framebuffer Vertical Sync from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetBacklight(Brightness:LongWord):LongWord;
Description: Set Framebuffer Backlight Brightness from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetNumDisplays(var NumDisplays:LongWord):LongWord;
Description: Get the number of displays from the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetDisplayId(DisplayNum:LongWord):LongWord;
Description: Get the display id for the specified display number from the Mailbox property tags channel
Note None documented


function RPi3FramebufferSetDisplayNum(DisplayNum:LongWord):LongWord;
Description: Get the display number that all framebuffer requests will refer to using the Mailbox property tags channel
Note None documented


function RPi3FramebufferGetDisplaySettings(DisplayNum:LongWord; var DisplaySettings:TDisplaySettings):LongWord;
Description: Get the display settings for the specified display number from the Mailbox property tags channel
Note None documented


function RPi3FramebufferDisplayIdToName(DisplayId:LongWord):String;
Description: Get the name for the specified display id
Note None documented


function RPi3TouchGetBuffer(var Address:PtrUInt):LongWord;
Description: Get the Touchscreen buffer from the Mailbox property tags channel
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.


function RPi3TouchSetBuffer(Address:PtrUInt):LongWord;
Description: Set the Touchscreen buffer in the Mailbox property tags channel
Note None documented


function RPi3VirtualGPIOGetBuffer(var Address:PtrUInt):LongWord;
Description: Get the Virtual GPIO buffer from the Mailbox property tags channel
Note None documented


function RPi3VirtualGPIOSetBuffer(Address:PtrUInt):LongWord;
Description: Set the Virtual GPIO buffer in the Mailbox property tags channel
Note None documented


function RPi3CursorSetDefault:LongWord;
Description: Set Cursor Default (Pixels) from the Mailbox property tags channel
Note None documented


function RPi3CursorSetInfo(Width,Height,HotspotX,HotspotY:LongWord; Pixels:Pointer; Length:LongWord):LongWord;
Description: Set Cursor Info (Pixels) from the Mailbox property tags channel
Note None documented


function RPi3CursorSetState(Enabled:Boolean; X,Y:LongWord; Relative:Boolean):LongWord;
Description: Set Cursor State (Enable, X, Y) from the Mailbox property tags channel
Relative X, Y is relative to Display (Virtual) not Framebuffer (Physical).


function RPi3DMAGetChannels:LongWord;
Description: Get the available DMA Channels from the Mailbox property tags channel
Note None documented


function RPi3VirtualGPIOAllocate:Boolean;
Description: Allocate the Virtual GPIO buffer either from memory or from the firmware
Note None documented


function RPi3VirtualGPIOInputGet(Pin:LongWord):LongWord;
Description: To be documented
Note None documented


function RPi3VirtualGPIOOutputSet(Pin,Level:LongWord):LongWord;
Description: To be documented
Note None documented


function RPi3VirtualGPIOFunctionSelect(Pin,Mode:LongWord):LongWord;
Description: To be documented
Note None documented


RPi3 thread functions

procedure RPi3SchedulerInit;
Description: Initialize the scheduler interrupt on the boot CPU
Note None documented


procedure RPi3SchedulerStart(CPUID:LongWord);
Description: Initialize the scheduler interrupt on the specified secondary CPU
Note None documented


procedure RPi3SecondaryBoot(CPUID:LongWord);
Description: To be documented
Note None documented


RPi3 SWI functions

function RPi3DispatchSWI(CPUID:LongWord; Thread:TThreadHandle; Request:PSystemCallRequest):TThreadHandle;
Description: Process an SWI request
Note Called by ARMv8SoftwareInterruptHandler in PlatformARMv8

A DataMemoryBarrier is executed before and after calling this function


RPi3 clock functions

procedure RPi3ClockInterrupt(Parameter:Pointer);
Description: Interrupt handler function for the clock interrupt
Note This schedules another clock interrupt to occur CLOCK_CYCLES_PER_TICK in the future, then updates ClockTicks and ClockSeconds and checks for timers to trigger.


procedure RPi3ClockUpdate(Cycles:LongWord; var Last:LongWord);
Description: Setup a clock interrupt to trigger after the specified number of clock cycles
Cycles Number of cycles after which the timer interrupt is to be triggered
Note This refers to native clock cycles as specified by CLOCK_FREQUENCY


RPi3 scheduler functions

function RPi3SchedulerInterrupt(CPUID:LongWord; Thread:TThreadHandle; Parameter:Pointer):TThreadHandle;
Description: Interrupt handler function for the scheduler interrupt
Note This schedules another scheduler interrupt to occur SCHEDULER_CLOCKS_PER_INTERRUPT in the future, then checks for threads to wakeup or timeout and the next thread to schedule.


procedure RPi3SchedulerUpdate(Cycles:LongWord; var Last:LongWord);
Description: Setup a scheduler interrupt to trigger after the specified number of clock cycles
Cycles Number of cycles after which the scheduler interrupt is to be triggered
Note This refers to native clock cycles as specified by RPI3_GENERIC_TIMER_FREQUENCY


procedure RPi3SchedulerSystemCall(Request:PSystemCallRequest);
Description: System Call handler for the scheduler
Note This is registered to receive requests for the SYSTEM_CALL_CONTEXT_SWITCH and will perform a context switch from within an SWI


RPi3 framebuffer functions

function RPi3FramebufferDeviceAllocate(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Allocate a framebuffer using the Mailbox Property Tags
Note None documented


function RPi3FramebufferDeviceAllocateAlt(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Allocate a framebuffer using a simple Mailbox Call
Note None documented


function RPi3FramebufferDeviceRelease(Framebuffer:PFramebufferDevice):LongWord;
Description: To be documented
Note None documented


function RPi3FramebufferDeviceBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Description: To be documented
Note None documented


function RPi3FramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags:LongWord):LongWord;
Description: To be documented
Note None documented


function RPi3FramebufferDeviceSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;
Description: To be documented
Note None documented


RPi3 helper functions

procedure RPi3Wait; assembler; nostackframe;
Description: To be documented
Note None documented


procedure RPi3LongWait; assembler; nostackframe;
Description: To be documented
Note None documented


procedure RPi3ShortWait; assembler; nostackframe;
Description: To be documented
Note None documented


procedure RPi3SlowBlink; assembler; nostackframe;
Description: To be documented
Note None documented


procedure RPi3FastBlink; assembler; nostackframe;
Description: To be documented
Note None documented


procedure RPi3BootBlink; assembler; nostackframe;
Description: Blink the Activity LED without dependency on any other RTL setup
Note None documented


procedure RPi3BootOutput(Value:LongWord);
Description: Output characters to UART0 without dependency on any other RTL setup
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)


procedure RPi3BootConsoleStart;
Description: To be documented
Note None documented


procedure RPi3BootConsoleWrite(const Value:String);
Description: To be documented
Note None documented


procedure RPi3BootConsoleWriteEx(const Value:String; X,Y:LongWord);
Description: To be documented
Note None documented


function RPi3BootConsoleGetX:LongWord;
Description: To be documented
Note None documented


function RPi3BootConsoleGetY:LongWord;
Description: To be documented
Note None documented


function RPi3ConvertPowerIdRequest(PowerId:LongWord):LongWord;
Description: Convert Ultibo Power Id to BCM2837 Power Id
Note None documented


function RPi3ConvertPowerStateRequest(PowerState:LongWord):LongWord;
Description: Convert Ultibo Power State to BCM2837 Power State
Note None documented


function RPi3ConvertPowerStateResponse(PowerState:LongWord):LongWord;
Description: Convert BCM2837 Power State to Ultibo Power State
Note None documented


function RPi3ConvertClockIdRequest(ClockId:LongWord):LongWord;
Description: Convert Ultibo Clock Id to BCM2837 Clock Id
Note None documented


function RPi3ConvertClockStateRequest(ClockState:LongWord):LongWord;
Description: Convert Ultibo Clock State to BCM2837 Clock State
Note None documented


function RPi3ConvertClockStateResponse(ClockState:LongWord):LongWord;
Description: Convert BCM2837 Clock State to Ultibo Clock State
Note None documented


function RPi3ConvertVoltageIdRequest(VoltageId:LongWord):LongWord;
Description: Convert Ultibo Voltage Id to BCM2837 Voltage Id
Note None documented


function RPi3ConvertTemperatureIdRequest(TemperatureId:LongWord):LongWord;
Description: Convert Ultibo Temperature Id to BCM2837 Temperature Id
Note None documented


Return to Unit Reference