Unit PlatformRPi2

From Ultibo.org
Revision as of 04:23, 10 November 2016 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


Description


The RPi2 B has the Power LED connected to GPIO Pin 35 (Activity LED is now on GPIO Pin 47).

The RPi3 B has the Activity LED connected to the GPU, access is via a Virtual GPIO (Power LED appears to be unavailable).

Constants


To be documented

Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

procedure RPi2Init;
Description: To be documented
Note None documented


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


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


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


RPi2 platform functions

procedure RPi2SMPInit;
Description: To be documented
Note None documented


procedure RPi2BoardInit;
Description: To be documented
Note None documented


procedure RPi2MemoryInit;
Description: To be documented
Note None documented


procedure RPi2ClockInit;
Description: To be documented
Note None documented


procedure RPi2PowerInit;
Description: To be documented
Note None documented


procedure RPi2MailboxInit;
Description: To be documented
Note None documented


procedure RPi2InterruptInit;
Description: To be documented
Note None documented


procedure RPi2PeripheralInit;
Description: To be documented
Note None documented


procedure RPi2FramebufferInit;
Description: To be documented
Note None documented


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


procedure RPi2PowerLEDEnable;
Description: To be documented
Note None documented


procedure RPi2PowerLEDOn;
Description: To be documented
Note None documented


procedure RPi2PowerLEDOff;
Description: To be documented
Note None documented


procedure RPi2ActivityLEDEnable;
Description: To be documented
Note None documented


procedure RPi2ActivityLEDOn;
Description: To be documented
Note None documented


procedure RPi2ActivityLEDOff;
Description: To be documented
Note None documented


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


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


function RPi2MailboxCall(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 RPi2MailboxCallEx(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 RPi2MailboxPropertyCall(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 RPi2MailboxPropertyCallEx(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 RPi2RequestExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request registration of the supplied handler to the specified IRQ number
CPUID CPU to route IRQ to
Number IRQ 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


function RPi2ReleaseExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request deregistration of the supplied handler from the specified IRQ number
CPUID CPU to route IRQ to
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


function RPi2RequestExFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request registration of the supplied handler to the specified FIQ number
CPUID CPU to route FIQ to
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


function RPi2ReleaseExFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request deregistration of the supplied handler from the specified FIQ number
CPUID CPU to route FIQ to
Number FIQ 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


function RPi2RegisterSystemCallEx(CPUID,Number:LongWord; Handler:TSystemCallHandler; HandlerEx:TSystemCallExHandler):LongWord;
Description: Request registration of the supplied extended handler to the specified System Call number
CPUID The CPU ID to register the System Call against (or CPU_ID_ALL)
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


function RPi2DeregisterSystemCallEx(CPUID,Number:LongWord; Handler:TSystemCallHandler; HandlerEx:TSystemCallExHandler):LongWord;
Description: Request deregistration of the supplied extended handler from the specified System Call number
CPUID The CPU ID to deregister the System Call from (or CPU_ID_ALL)
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


function RPi2GetInterruptEntry(Number:LongWord):TInterruptEntry;
Description: Get the interrupt entry for the specified interrupt number
Note None documented


function RPi2GetLocalInterruptEntry(CPUID,Number:LongWord):TInterruptEntry;
Description: Get the local interrupt entry for the specified interrupt number
Note None documented


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


function RPi2ClockGetCount: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 RPi2ClockGetTotal: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 RPi2ClockGetRate(ClockId:LongWord):LongWord;
Description: Get the Clock Rate from the Mailbox property tags channel
Note None documented


function RPi2Clock?etRate(ClockId,Rate:LongWord; Turbo:Boolean):LongWord;
Description: ?et the Clock Rate in the Mailbox property tags channel
Note None documented


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


function RPi2Clock?etState(ClockId,State:LongWord):LongWord;
Description: ?et the Clock State in the Mailbox property tags channel
Note None documented


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


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


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


function RPi2Turbo?etState(TurboId,State:LongWord):LongWord;
Description: ?et the Turbo State in the Mailbox property tags channel
Note None documented


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


function RPi2Voltage?etValue(VoltageId,Value:LongWord):LongWord;
Description: ?et the Voltage Value in the Mailbox property tags channel
Note None documented


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


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


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


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


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


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


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


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


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


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


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


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


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


function RPi2Framebuffer?etState(State:LongWord):LongWord;
Description: ?et Framebuffer State (Blank Screen) from the Mailbox property tags channel
Note None documented


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


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


function RPi2Framebuffer?etPhysical(var Width,Height:LongWord):LongWord;
Description: ?et Framebuffer Physical size from the Mailbox property tags channel
Note None documented


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


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


function RPi2Framebuffer?etVirtual(var Width,Height:LongWord):LongWord;
Description: ?et Framebuffer Virtual size from the Mailbox property tags channel
Note None documented


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


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


function RPi2Framebuffer?etDepth(var Depth:LongWord):LongWord;
Description: ?et Framebuffer Depth (Bits per pixel) from the Mailbox property tags channel
Note None documented


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


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


function RPi2Framebuffer?etPixelOrder(var Order:LongWord):LongWord;
Description: ?et Framebuffer Pixel Order (RGB) from the Mailbox property tags channel
Note None documented


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


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


function RPi2Framebuffer?etAlphaMode(var Mode:LongWord):LongWord;
Description: ?et Framebuffer Alpha Mode from the Mailbox property tags channel
Note None documented


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


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


function RPi2FramebufferGetOff?et(var X,Y:LongWord):LongWord;
Description: Get Framebuffer Virtual Off?et from the Mailbox property tags channel
Note None documented


function RPi2Framebuffer?etOff?et(var X,Y:LongWord):LongWord;
Description: ?et Framebuffer Virtual Off?et from the Mailbox property tags channel
Note None documented


function RPi2FramebufferTestOff?et(var X,Y:LongWord):LongWord;
Description: Test Framebuffer Virtual Off?et from the Mailbox property tags channel
Note None documented


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


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


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


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


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


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


function RPi2Framebuffer?etBacklight(Brightness:LongWord):LongWord;
Description: ?et Framebuffer Backlight Brightness from the Mailbox property tags channel
Note None documented


function RPi2TouchGetBuffer(var Address:LongWord):LongWord;
Description: Get the Touchscreen buffer from the Mailbox property tags channel
Note None documented


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


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


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


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


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


function RPi2VirtualGPIOOutput?et(Pin,Level:LongWord):LongWord;
Description: To be documented
Note None documented


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


Return to Unit Reference