Difference between revisions of "Unit PlatformRPi"
Line 15: | Line 15: | ||
---- | ---- | ||
− | '' | + | ''None defined'' |
=== Public variables === | === Public variables === |
Revision as of 06:17, 1 December 2016
Return to Unit Reference
Description
The RPi A+/B+ have the Power LED connected to GPIO Pin 35 (Activity LED is now on GPIO Pin 47 instead of Pin 16 in model A/B).
Constants
To be documented
Type definitions
None defined
Public variables
To be documented
Function declarations
Initialization functions
procedure RPiInit;
Note | None documented |
---|
RPi platform functions
procedure RPiBoardInit;
Note | None documented |
---|
procedure RPiMemoryInit;
Note | None documented |
---|
procedure RPiClockInit;
Note | None documented |
---|
procedure RPiPowerInit;
Note | None documented |
---|
procedure RPiMailboxInit;
Note | None documented |
---|
procedure RPiInterruptInit;
Note | None documented |
---|
procedure RPiPeripheralInit;
Note | None documented |
---|
procedure RPiFramebufferInit;
Note | None documented |
---|
procedure RPiPageTableInit;
Note | See page 6-36 of the ARM1176JZF-S Technical Reference Manual |
---|
procedure RPiPowerLEDEnable;
Note | None documented |
---|
procedure RPiPowerLEDOn;
Note | None documented |
---|
procedure RPiPowerLEDOff;
Note | None documented |
---|
procedure RPiActivityLEDEnable;
Note | None documented |
---|
procedure RPiActivityLEDOn;
Note | None documented |
---|
procedure RPiActivityLEDOff;
Note | None documented |
---|
function RPiMailboxReceive(Mailbox,Channel:LongWord):LongWord;
Note | Data = first 28 bits, Channel = last 4 bits |
---|
procedure RPiMailboxSend(Mailbox,Channel,Data:LongWord);
Note | Data = first 28 bits, Channel = last 4 bits |
---|
function RPiMailboxCall(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 RPiMailboxCallEx(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 RPiMailboxPropertyCall(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 RPiMailboxPropertyCallEx(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 RPiRequestExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
CPUID | CPU to route IRQ to (Ignored on RPi) |
---|---|
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 RPiReleaseExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
CPUID | CPU to route IRQ to (Ignored on RPi) |
---|---|
Number | IRQ number to deregister |
Handler | Interrupt handler function to deregister |
HandlerEx | Extended Interrupt handler function to deregister |
Note | Only one of Handler or HandlerEx can be specified |
function RPiRequestExFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
CPUID | CPU to route FIQ to (Ignored on RPi) |
---|---|
Number | FIQ number to register |
Handler | Interrupt handler function to register |
HandlerEx | Extended Interrupt handler function to register |
Note | Only one of Handler or HandlerEx can be specified |
function RPiReleaseExFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
CPUID | CPU to route FIQ to (Ignored on RPi) |
---|---|
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 RPiRegisterSystemCallEx(CPUID,Number:LongWord; Handler:TSystemCallHandler; HandlerEx:TSystemCallExHandler):LongWord;
CPUID | The CPU ID to register the System Call against (Ignored on RPi) |
---|---|
Number | The System Call number to be registered |
Handler | The handler function to be registered |
HandlerEx | The extended handler function to be registered |
Note | Only one of Handler or HandlerEx can be specified |
function RPiDeregisterSystemCallEx(CPUID,Number:LongWord; Handler:TSystemCallHandler; HandlerEx:TSystemCallExHandler):LongWord;
CPUID | The CPU ID to deregister the System Call from (Ignored on RPi) |
---|---|
Number | The System Call number to be deregistered |
Handler | The handler function to be deregistered |
HandlerEx | The extended handler function to be deregistered |
Note | Only one of Handler or HandlerEx can be specified |
function RPiGetInterruptEntry(Number:LongWord):TInterruptEntry;
Note | None documented |
---|
function RPiGetSystemCallEntry(Number:LongWord):TSystemCallEntry;
Note | Get the system call entry for the specified system call number |
---|
function RPiSystemRestart(Delay:LongWord):LongWord;
Note | None documented |
---|
function RPiSystemShutdown(Delay:LongWord):LongWord;
Note | None documented |
---|
function RPiSystemGetCommandLine:String;
Note | None documented |
---|
function RPiCPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord;
Note | None documented |
---|
function RPiGPUGetState:LongWord;
Note | None documented |
---|
function RPiGPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord;
Note | None documented |
---|
function RPiBoardGetModel:LongWord;
Note | None documented |
---|
function RPiBoardGetSerial:Int64;
Note | None documented |
---|
function RPiBoardGetRevision:LongWord;
Note | None documented |
---|
function RPiBoardGetMACAddress:String;
Note | None documented |
---|
function RPiFirmwareGetRevision:LongWord;
Note | None documented |
---|
function RPiPowerGetWait(PowerId:LongWord):LongWord;
Note | None documented |
---|
function RPiPowerGetState(PowerId:LongWord):LongWord;
Note | None documented |
---|
function RPiPowerSetState(PowerId,State:LongWord; Wait:Boolean):LongWord;
Note | Power Lock not required due to Mailbox Property Call serialization |
---|
function RPiClockGetCount: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 RPiClockGetTotal: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 RPiClockGetRate(ClockId:LongWord):LongWord;
Note | None documented |
---|
function RPiClockSetRate(ClockId,Rate:LongWord; Turbo:Boolean):LongWord;
Note | None documented |
---|
function RPiClockGetState(ClockId:LongWord):LongWord;
Note | None documented |
---|
function RPiClockSetState(ClockId,State:LongWord):LongWord;
Note | None documented |
---|
function RPiClockGetMinRate(ClockId:LongWord):LongWord;
Note | None documented |
---|
function RPiClockGetMaxRate(ClockId:LongWord):LongWord;
Note | None documented |
---|
function RPiTurboGetState(TurboId:LongWord):LongWord;
Note | None documented |
---|
function RPiTurboSetState(TurboId,State:LongWord):LongWord;
Note | None documented |
---|
function RPiVoltageGetValue(VoltageId:LongWord):LongWord;
Note | None documented |
---|
function RPiVoltageSetValue(VoltageId,Value:LongWord):LongWord;
Note | None documented |
---|
function RPiVoltageGetMinValue(VoltageId:LongWord):LongWord;
Note | None documented |
---|
function RPiVoltageGetMaxValue(VoltageId:LongWord):LongWord;
Note | None documented |
---|
function RPiTemperatureGetCurrent(TemperatureId:LongWord):LongWord;
Note | None documented |
---|
function RPiTemperatureGetMaximum(TemperatureId:LongWord):LongWord;
Note | None documented |
---|
function RPiGPUMemoryAllocate(Length,Alignment,Flags:LongWord):THandle;
Note | None documented |
---|
function RPiGPUMemoryRelease(Handle:THandle):LongWord;
Note | None documented |
---|
function RPiGPUMemoryLock(Handle:THandle):LongWord;
Note | None documented |
---|
function RPiGPUMemoryUnlock(Handle:THandle):LongWord;
Note | None documented |
---|
function RPiGPUExecuteCode(Address:Pointer; R0,R1,R2,R3,R4,R5:LongWord):LongWord;
Note | None documented |
---|
function RPiDispmanxHandleGet(Resource:THandle):THandle;
Note | None documented |
---|
function RPiEDIDBlockGet(Block:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferAllocate(Alignment:LongWord; var Address,Length:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferRelease:LongWord;
Note | None documented |
---|
function RPiFramebufferSetState(State:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferGetDimensions(var Width,Height,Top,Bottom,Left,Right:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferGetPhysical(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferSetPhysical(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferTestPhysical(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferGetVirtual(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferSetVirtual(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferTestVirtual(var Width,Height:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferGetDepth(var Depth:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferSetDepth(var Depth:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferTestDepth(var Depth:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferGetPixelOrder(var Order:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferSetPixelOrder(var Order:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferTestPixelOrder(var Order:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferGetAlphaMode(var Mode:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferSetAlphaMode(var Mode:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferTestAlphaMode(var Mode:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferGetPitch:LongWord;
Note | None documented |
---|
function RPiFramebufferGetOffset(var X,Y:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferSetOffset(var X,Y:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferTestOffset(var X,Y:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferGetOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferSetOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferTestOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferGetPalette(Buffer:Pointer; Length:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferSetPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferTestPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferTestVsync:LongWord;
Note | None documented |
---|
function RPiFramebufferSetVsync:LongWord;
Note | None documented |
---|
function RPiFramebufferSetBacklight(Brightness:LongWord):LongWord;
Note | None documented |
---|
function RPiTouchGetBuffer(var Address:LongWord):LongWord;
Note | None documented |
---|
function RPiCursorSetDefault:LongWord;
Note | None documented |
---|
function RPiCursorSetInfo(Width,Height,HotspotX,HotspotY:LongWord; Pixels:Pointer; Length:LongWord):LongWord;
Note | None documented |
---|
function RPiCursorSetState(Enabled:Boolean; X,Y:LongWord; Relative:Boolean):LongWord;
Relative | X, Y is relative to Display (Virtual) not Framebuffer (Physical) |
---|
function RPiDMAGetChannels:LongWord;
Note | None documented |
---|
RPi tthread functions
procedure RPiSchedulerInit;
Note | None documented |
---|
RPi IRQ functions
function RPiDispatchIRQ(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Note | Called by ARMv6IRQHandler in PlatformARMv6
A DataMemoryBarrier is executed before and after calling this function |
---|
function RPiHandleIRQ(Number,CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Note | None documented |
---|
RPi FIQ functions
function RPiDispatchFIQ(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Note | Called by ARMv6FIQHandler in PlatformARMv6
A DataMemoryBarrier is executed before and after calling this function |
---|
function RPiHandleFIQ(Number,CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Note | None documented |
---|
RPi SWI functions
function RPiDispatchSWI(CPUID:LongWord; Thread:TThreadHandle; Request:PSystemCallRequest):TThreadHandle;
Note | Called by ARMv6SoftwareInterruptHandler in PlatformARMv6
A DataMemoryBarrier is executed before and after calling this function |
---|
RPi clock functions
procedure RPiClockInterrupt(Parameter:Pointer);
Note | This schedules another clock interrupt to occur CLOCK_CYCLES_PER_TICK in the future, then updates ClockTicks and ClockSeconds. |
---|
procedure RPiClockUpdate(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 |
RPi scheduler functions
function RPiSchedulerInterrupt(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 and the next thread to schedule. |
---|
procedure RPiSchedulerUpdate(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 CLOCK_FREQUENCY |
procedure RPiSchedulerSystemCall(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 |
---|
RPi framebuffer functions
function RPiFramebufferDeviceAllocate(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Note | None documented |
---|
function RPiFramebufferDeviceAllocateAlt(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Note | None documented |
---|
function RPiFramebufferDeviceRelease(Framebuffer:PFramebufferDevice):LongWord;
Note | None documented |
---|
function RPiFramebufferDeviceBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Note | None documented |
---|
function RPiFramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address,Size,Flags:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferDeviceSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;
Note | None documented |
---|
function RPiFramebufferDeviceSetProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Note | None documented |
---|
RPi helper functions
procedure RPiWait; assembler; nostackframe;
Note | None documented |
---|
procedure RPiLongWait; assembler; nostackframe;
Note | None documented |
---|
procedure RPiShortWait; assembler; nostackframe;
Note | None documented |
---|
procedure RPiSlowBlink; assembler; nostackframe;
Note | None documented |
---|
procedure RPiFastBlink; assembler; nostackframe;
Note | None documented |
---|
procedure RPiBootBlink; assembler; nostackframe;
Note | This currently only works for RPiA+/B+ |
---|
function RPiConvertPowerIdRequest(PowerId:LongWord):LongWord;
Note | None documented |
---|
function RPiConvertPowerStateRequest(PowerState:LongWord):LongWord;
Note | None documented |
---|
function RPiConvertPowerStateResponse(PowerState:LongWord):LongWord;
Note | None documented |
---|
function RPiConvertClockIdRequest(ClockId:LongWord):LongWord;
Note | None documented |
---|
function RPiConvertClockStateRequest(ClockState:LongWord):LongWord;
Note | None documented |
---|
function RPiConvertClockStateResponse(ClockState:LongWord):LongWord;
Note | None documented |
---|
function RPiConvertVoltageIdRequest(VoltageId:LongWord):LongWord;
Note | None documented |
---|
function RPiConvertTemperatureIdRequest(TemperatureId:LongWord):LongWord;
Note | None documented |
---|
Return to Unit Reference