Difference between revisions of "Unit PlatformRPi2"
Line 1,608: | Line 1,608: | ||
! '''Note''' | ! '''Note''' | ||
| This is registered to receive requests for the SYSTEM_CALL_CONTEXT_SWITCH and will perform a context switch from within an SWI | | 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 /> | ||
+ | |||
+ | '''RPi2 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 RPi2FramebufferDeviceAllocate(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 RPi2FramebufferDeviceAllocateAlt(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 RPi2FramebufferDeviceRelease(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 RPi2FramebufferDeviceBlank(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 RPi2FramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address,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 RPi2FramebufferDevice?etBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferDevice?etProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):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 | ||
|- | |- | ||
|} | |} |
Revision as of 04:28, 10 November 2016
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;
Note | None documented |
---|
procedure RPi2SecondarySwitch; assembler; nostackframe;
Note | None documented |
---|
procedure RPi2SecondarySecure; assembler; nostackframe;
Note | None documented |
---|
procedure RPi2SecondaryHandler; assembler; nostackframe;
Note | None documented |
---|
RPi2 platform functions
procedure RPi2SMPInit;
Note | None documented |
---|
procedure RPi2BoardInit;
Note | None documented |
---|
procedure RPi2MemoryInit;
Note | None documented |
---|
procedure RPi2ClockInit;
Note | None documented |
---|
procedure RPi2PowerInit;
Note | None documented |
---|
procedure RPi2MailboxInit;
Note | None documented |
---|
procedure RPi2InterruptInit;
Note | None documented |
---|
procedure RPi2PeripheralInit;
Note | None documented |
---|
procedure RPi2FramebufferInit;
Note | None documented |
---|
procedure RPi2PageTableInit;
Note | None documented |
---|
procedure RPi2PowerLEDEnable;
Note | None documented |
---|
procedure RPi2PowerLEDOn;
Note | None documented |
---|
procedure RPi2PowerLEDOff;
Note | None documented |
---|
procedure RPi2ActivityLEDEnable;
Note | None documented |
---|
procedure RPi2ActivityLEDOn;
Note | None documented |
---|
procedure RPi2ActivityLEDOff;
Note | None documented |
---|
function RPi2MailboxReceive(Mailbox,Channel:LongWord):LongWord;
Note | Data = first 28 bits, Channel = last 4 bits |
---|
procedure RPi2MailboxSend(Mailbox,Channel,Data:LongWord);
Note | Data = first 28 bits, Channel = last 4 bits |
---|
function RPi2MailboxCall(Mailbox,Channel,Data:LongWord; var Response:LongWord):LongWord;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
Note | None documented |
---|
function RPi2GetLocalInterruptEntry(CPUID,Number:LongWord):TInterruptEntry;
Note | None documented |
---|
function RPi2GetSystemCallEntry(Number:LongWord):TSystemCallEntry;
Note | None documented |
---|
function RPi2SystemRestart(Delay:LongWord):LongWord;
Note | None documented |
---|
function RPi2SystemShutdown(Delay:LongWord):LongWord;
Note | None documented |
---|
function RPi2SystemGetCommandLine:String;
Note | None documented |
---|
function RPi2CPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord;
Note | None documented |
---|
function RPi2GPUGetState:LongWord;
Note | None documented |
---|
function RPi2GPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord;
Note | None documented |
---|
function RPi2BoardGetModel:LongWord;
Note | None documented |
---|
function RPi2BoardGetSerial:Int64;
Note | None documented |
---|
function RPi2BoardGetRevision:LongWord;
Note | None documented |
---|
function RPi2BoardGetMACAddress:String;
Note | None documented |
---|
function RPi2FirmwareGetRevision:LongWord;
Note | None documented |
---|
function RPi2PowerGetWait(PowerId:LongWord):LongWord;
Note | None documented |
---|
function RPi2PowerGetState(PowerId:LongWord):LongWord;
Note | None documented |
---|
function RPi2Power?etState(PowerId,State:LongWord; Wait:Boolean):LongWord;
Note | Power Lock not required due to Mailbox Property Call serialization |
---|
function RPi2ClockGetCount:LongWord;
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;
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;
Note | None documented |
---|
function RPi2Clock?etRate(ClockId,Rate:LongWord; Turbo:Boolean):LongWord;
Note | None documented |
---|
function RPi2ClockGetState(ClockId:LongWord):LongWord;
Note | None documented |
---|
function RPi2Clock?etState(ClockId,State:LongWord):LongWord;
Note | None documented |
---|
function RPi2ClockGetMinRate(ClockId:LongWord):LongWord;
Note | None documented |
---|
function RPi2ClockGetMaxRate(ClockId:LongWord):LongWord;
Note | None documented |
---|
function RPi2TurboGetState(TurboId:LongWord):LongWord;
Note | None documented |
---|
function RPi2Turbo?etState(TurboId,State:LongWord):LongWord;
Note | None documented |
---|
function RPi2VoltageGetValue(VoltageId:LongWord):LongWord;
Note | None documented |
---|
function RPi2Voltage?etValue(VoltageId,Value:LongWord):LongWord;
Note | None documented |
---|
function RPi2VoltageGetMinValue(VoltageId:LongWord):LongWord;
Note | None documented |
---|
function RPi2VoltageGetMaxValue(VoltageId:LongWord):LongWord;
Note | None documented |
---|
function RPi2TemperatureGetCurrent(TemperatureId:LongWord):LongWord;
Note | None documented |
---|
function RPi2TemperatureGetMaximum(TemperatureId:LongWord):LongWord;
Note | None documented |
---|
function RPi2GPUMemoryAllocate(Length,Alignment,Flags:LongWord):THandle;
Note | None documented |
---|
function RPi2GPUMemoryRelease(Handle:THandle):LongWord;
Note | None documented |
---|
function RPi2GPUMemoryLock(Handle:THandle):LongWord;
Note | None documented |
---|
function RPi2GPUMemoryUnlock(Handle:THandle):LongWord;
Note | None documented |
---|
function RPi2GPUExecuteCode(Address:Pointer; R0,R1,R2,R3,R4,R5:LongWord):LongWord;
Note | None documented |
---|
function RPi2DispmanxHandleGet(Resource:THandle):THandle;
Note | None documented |
---|
function RPi2EDIDBlockGet(Block:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferAllocate(Alignment:LongWord; var Address,Length:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferRelease:LongWord;
Note | None documented |
---|
function RPi2Framebuffer?etState(State:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferGetDimensions(var Width,Height,Top,Bottom,Left,Right:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferGetPhysical(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPi2Framebuffer?etPhysical(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferTestPhysical(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferGetVirtual(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPi2Framebuffer?etVirtual(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferTestVirtual(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferGetDepth(var Depth:LongWord):LongWord;
Note | None documented |
---|
function RPi2Framebuffer?etDepth(var Depth:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferTestDepth(var Depth:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferGetPixelOrder(var Order:LongWord):LongWord;
Note | None documented |
---|
function RPi2Framebuffer?etPixelOrder(var Order:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferTestPixelOrder(var Order:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferGetAlphaMode(var Mode:LongWord):LongWord;
Note | None documented |
---|
function RPi2Framebuffer?etAlphaMode(var Mode:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferTestAlphaMode(var Mode:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferGetPitch:LongWord;
Note | None documented |
---|
function RPi2FramebufferGetOff?et(var X,Y:LongWord):LongWord;
Note | None documented |
---|
function RPi2Framebuffer?etOff?et(var X,Y:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferTestOff?et(var X,Y:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferGetOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Note | None documented |
---|
function RPi2Framebuffer?etOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferTestOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferGetPalette(Buffer:Pointer; Length:LongWord):LongWord;
Note | None documented |
---|
function RPi2Framebuffer?etPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferTestPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Note | None documented |
---|
function RPi2Framebuffer?etBacklight(Brightness:LongWord):LongWord;
Note | None documented |
---|
function RPi2TouchGetBuffer(var Address:LongWord):LongWord;
Note | None documented |
---|
function RPi2VirtualGPIOGetBuffer(var Address:LongWord):LongWord;
Note | None documented |
---|
function RPi2Cursor?etInfo(Width,Height,HotspotX,HotspotY:LongWord; Pixels:Pointer; Length:LongWord):LongWord;
Note | None documented |
---|
function RPi2Cursor?etState(Enabled:Boolean; X,Y:LongWord; Relative:Boolean):LongWord;
Relative | X, Y is relative to Display (Virtual) not Framebuffer (Physical) |
---|
function RPi2DMAGetChannels:LongWord;
Note | None documented |
---|
function RPi2VirtualGPIOInputGet(Pin:LongWord):LongWord;
Note | None documented |
---|
function RPi2VirtualGPIOOutput?et(Pin,Level:LongWord):LongWord;
Note | None documented |
---|
function RPi2VirtualGPIOFunctionSelect(Pin,Mode:LongWord):LongWord;
Note | None documented |
---|
RPi2 thread functions
procedure RPi2SchedulerInit;
Note | None documented |
---|
procedure RPi2SchedulerStart(CPUID:LongWord);
Note | None documented |
---|
procedure RPi2SecondaryBoot(CPUID:LongWord);
Note | None documented |
---|
RPi2 IRQ functions
function RPi2DispatchIRQ(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Note | Called by ARMv7IRQHandler in PlatformARMv7
A DataMemoryBarrier is executed before and after calling this function |
---|
function RPi2HandleIRQ(Number,CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Note | None documented |
---|
RPi2 FIQ functions
function RPi2DispatchFIQ(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Note | Called by ARMv7FIQHandler in PlatformARMv7
A DataMemoryBarrier is executed before and after calling this function |
---|
function RPi2HandleFIQ(Number,CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Note | None documented |
---|
RPi2 SWI functions
function RPi2DispatchSWI(CPUID:LongWord; Thread:TThreadHandle; Request:PSystemCallRequest):TThreadHandle;
Note | Called by ARMv7SoftwareInterruptHandler in PlatformARMv7
A DataMemoryBarrier is executed before and after calling this function |
---|
RPi2 clock functions
procedure RPi2ClockInterrupt(Parameter:Pointer);
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 RPi2ClockUpdate(Cycles:LongWord; var Last:LongWord);
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 |
RPi2 scheduler functions
function RPi2SchedulerInterrupt(CPUID:LongWord; Thread:TThreadHandle; Parameter:Pointer):TThreadHandle;
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 RPi2SchedulerUpdate(Cycles:LongWord; var Last:LongWord);
Cycles | Number of cycles after which the scheduler interrupt is to be triggered |
---|---|
Note | This refers to native clock cycles as specified by RPI2_GENERIC_TIMER_FREQUENCY |
procedure RPi2SchedulerSystemCall(Request:PSystemCallRequest);
Note | This is registered to receive requests for the SYSTEM_CALL_CONTEXT_SWITCH and will perform a context switch from within an SWI |
---|
RPi2 framebuffer functions
function RPi2FramebufferDeviceAllocate(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Note | None documented |
---|
function RPi2FramebufferDeviceAllocateAlt(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Note | None documented |
---|
function RPi2FramebufferDeviceRelease(Framebuffer:PFramebufferDevice):LongWord;
Note | None documented |
---|
function RPi2FramebufferDeviceBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Note | None documented |
---|
function RPi2FramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address,Size,Flags:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferDevice?etBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;
Note | None documented |
---|
function RPi2FramebufferDevice?etProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Note | None documented |
---|
Return to Unit Reference