Difference between revisions of "Unit RPISENSEHAT"
(5 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '''Raspberry Pi | + | '''Raspberry Pi Sense HAT Driver unit''' |
− | The | + | The Sense HAT 8x8 LED matrix is presented in Ultibo as an 8x8 pixel framebuffer. This allows full access to the display at both the individual pixel level and also using the higher level console functions to display text and graphics on the matrix. |
− | The framebuffer device supports rotation around the full 360 degrees by supplying the required rotation value in the framebuffer properties when calling FramebufferAllocate() or by calling the | + | The framebuffer device supports rotation around the full 360 degrees by supplying the required rotation value in the framebuffer properties when calling FramebufferAllocate() or by calling the Sense HAT specific function RPiSenseFramebufferSetRotation(). |
As per the official Python libraries, the default rotation (FRAMEBUFFER_ROTATION_0) gives correct viewing when the HDMI port is facing downwards. | As per the official Python libraries, the default rotation (FRAMEBUFFER_ROTATION_0) gives correct viewing when the HDMI port is facing downwards. | ||
− | The | + | The Sense HAT joystick appears as a keyboard device and the pressed buttons are received as key presses that represent the Left, Right, Up, Down and Enter keys. |
=== Constants === | === Constants === | ||
Line 350: | Line 350: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Called only during system startup | | Called only during system startup | ||
|- | |- | ||
Line 362: | Line 362: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! I2C |
− | | The name of the I2C device that the | + | | The name of the I2C device that the Sense HAT is connected to |
|- | |- | ||
− | ! | + | ! GPIO |
− | | The name of the GPIO device that the | + | | The name of the GPIO device that the Sense HAT is connected to |
|- | |- | ||
− | ! | + | ! Rotation |
| The rotation value of the framebuffer (eg FRAMEBUFFER_ROTATION_180) | | The rotation value of the framebuffer (eg FRAMEBUFFER_ROTATION_180) | ||
|- | |- | ||
− | ! | + | ! Width |
| The width of the framebuffer in pixels (Virtual width only, the Physical width is fixed at 8 pixels) | | The width of the framebuffer in pixels (Virtual width only, the Physical width is fixed at 8 pixels) | ||
|- | |- | ||
− | ! | + | ! Height |
| The height of the framebuffer in pixels (Virtual height only, the Physical height is fixed at 8 pixels) | | The height of the framebuffer in pixels (Virtual height only, the Physical height is fixed at 8 pixels) | ||
|- | |- | ||
− | ! | + | ! Return |
| The handle of the RPiSenseHat on success or INVALID_HANDLE_VALUE on failure | | The handle of the RPiSenseHat on success or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| This function will be called during startup if the parameter RPISENSE_AUTOSTART is True | | This function will be called during startup if the parameter RPISENSE_AUTOSTART is True | ||
|- | |- | ||
Line 392: | Line 392: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Handle |
| The handle of the RPiSenseHat or INVALID_HANDLE_VALUE for the default | | The handle of the RPiSenseHat or INVALID_HANDLE_VALUE for the default | ||
|- | |- | ||
− | ! | + | ! Return |
| True if completed or False on failure | | True if completed or False on failure | ||
|- | |- | ||
Line 410: | Line 410: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! I2C |
| The I2C device that the RPiSenseHat is connected to | | The I2C device that the RPiSenseHat is connected to | ||
|- | |- | ||
− | ! | + | ! Name |
| The text description of this device which will show in the device list (Optional) | | The text description of this device which will show in the device list (Optional) | ||
|- | |- | ||
− | ! | + | ! Rotation |
| The rotation value of the framebuffer (eg FRAMEBUFFER_ROTATION_180) | | The rotation value of the framebuffer (eg FRAMEBUFFER_ROTATION_180) | ||
|- | |- | ||
− | ! | + | ! Width |
| The width of the framebuffer in pixels (Virtual width only, the Physical width is fixed at 8 pixels) | | The width of the framebuffer in pixels (Virtual width only, the Physical width is fixed at 8 pixels) | ||
|- | |- | ||
− | ! | + | ! Height |
| The height of the framebuffer in pixels (Virtual height only, the Physical height is fixed at 8 pixels) | | The height of the framebuffer in pixels (Virtual height only, the Physical height is fixed at 8 pixels) | ||
|- | |- | ||
− | ! | + | ! Return |
| Pointer to the new Framebuffer device or nil if the framebuffer device could not be created | | Pointer to the new Framebuffer device or nil if the framebuffer device could not be created | ||
|- | |- | ||
Line 437: | Line 437: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Framebuffer |
| The Framebuffer device to destroy | | The Framebuffer device to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 452: | Line 452: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use FramebufferDeviceAllocate instead | + | | Not intended to be called directly by applications, use FramebufferDeviceAllocate instead. |
|- | |- | ||
|} | |} | ||
Line 464: | Line 464: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use FramebufferDeviceRelease instead | + | | Not intended to be called directly by applications, use FramebufferDeviceRelease instead. |
|- | |- | ||
|} | |} | ||
Line 476: | Line 476: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use FramebufferDevicBlank instead | + | | Not intended to be called directly by applications, use FramebufferDevicBlank instead. |
|- | |- | ||
|} | |} | ||
Line 488: | Line 488: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use FramebufferDeviceMark instead | + | | Not intended to be called directly by applications, use FramebufferDeviceMark instead. |
Marks full lines only, X and Width are ignored for RPiSenseHat Framebuffer | Marks full lines only, X and Width are ignored for RPiSenseHat Framebuffer | ||
|- | |- | ||
Line 496: | Line 496: | ||
<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 RPiSenseFramebufferCommit(Framebuffer:PFramebufferDevice; Address | + | <pre style="border: 0; padding-bottom:0px;">function RPiSenseFramebufferCommit(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags:LongWord):LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of FramebufferDeviceCommit API for RPiSenseHat Framebuffer</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of FramebufferDeviceCommit API for RPiSenseHat Framebuffer</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 |
− | | Not intended to be called directly by applications, use FramebufferDeviceCommit instead | + | | Not intended to be called directly by applications, use FramebufferDeviceCommit instead. |
|- | |- | ||
|} | |} | ||
Line 513: | Line 513: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use FramebufferDeviceSetOffset instead | + | | Not intended to be called directly by applications, use FramebufferDeviceSetOffset instead. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
|} | |} | ||
Line 537: | Line 525: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Framebuffer |
| The Framebuffer device to get from | | The Framebuffer device to get from | ||
|- | |- | ||
− | ! | + | ! Gamma |
| An array of gamma values returned on completion | | An array of gamma values returned on completion | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 555: | Line 543: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Framebuffer |
| The Framebuffer device to set for | | The Framebuffer device to set for | ||
|- | |- | ||
− | ! | + | ! Gamma |
| An array of gamma values to set | | An array of gamma values to set | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 573: | Line 561: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Framebuffer |
| The Framebuffer device to set for | | The Framebuffer device to set for | ||
|- | |- | ||
− | ! | + | ! Value |
| The gamma values to set (0 = Default / 1 = Low / 2 = User) | | The gamma values to set (0 = Default / 1 = Low / 2 = User) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 591: | Line 579: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 603: | Line 591: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 618: | Line 606: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! I2C |
| The I2C device that the RPiSenseHat is connected to | | The I2C device that the RPiSenseHat is connected to | ||
|- | |- | ||
− | ! | + | ! GPIO |
| The GPIO device that the RPiSenseHat is connected to | | The GPIO device that the RPiSenseHat is connected to | ||
|- | |- | ||
− | ! | + | ! Name |
| The text description of this device which will show in the device list (Optional) | | The text description of this device which will show in the device list (Optional) | ||
|- | |- | ||
− | ! | + | ! Return |
| Pointer to the new Joystick (Keyboard) device or nil if the device could not be created | | Pointer to the new Joystick (Keyboard) device or nil if the device could not be created | ||
|- | |- | ||
Line 639: | Line 627: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Joystick |
| The Joystick (Keyboard) device to destroy | | The Joystick (Keyboard) device to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 654: | Line 642: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 669: | Line 657: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! I2C |
| The I2C device the RPiSenseHat is connected to | | The I2C device the RPiSenseHat is connected to | ||
|- | |- | ||
− | ! | + | ! Address |
| The I2C address of the RPiSenseHat | | The I2C address of the RPiSenseHat | ||
|- | |- | ||
− | ! | + | ! Reg |
| The register to read | | The register to read | ||
|- | |- | ||
− | ! | + | ! Return |
| The register value on success or -1 on failure | | The register value on success or -1 on failure | ||
|- | |- | ||
Line 690: | Line 678: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! I2C |
| The I2C device the RPiSenseHat is connected to | | The I2C device the RPiSenseHat is connected to | ||
|- | |- | ||
− | ! | + | ! Address |
| The I2C address of the RPiSenseHat | | The I2C address of the RPiSenseHat | ||
|- | |- | ||
− | ! | + | ! Data |
| Pointer to the data block to be written | | Pointer to the data block to be written | ||
|- | |- | ||
− | ! | + | ! Size |
| Size of the data block in bytes | | Size of the data block in bytes | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- |
Latest revision as of 05:07, 23 November 2022
Return to Unit Reference
Description
Raspberry Pi Sense HAT Driver unit
The Sense HAT 8x8 LED matrix is presented in Ultibo as an 8x8 pixel framebuffer. This allows full access to the display at both the individual pixel level and also using the higher level console functions to display text and graphics on the matrix.
The framebuffer device supports rotation around the full 360 degrees by supplying the required rotation value in the framebuffer properties when calling FramebufferAllocate() or by calling the Sense HAT specific function RPiSenseFramebufferSetRotation().
As per the official Python libraries, the default rotation (FRAMEBUFFER_ROTATION_0) gives correct viewing when the HDMI port is facing downwards.
The Sense HAT joystick appears as a keyboard device and the pressed buttons are received as key presses that represent the Left, Right, Up, Down and Enter keys.
Constants
RPISENSE_*
RPISENSE_SIGNATURE = $EAEBECED;
|
RPISENSE_FRAMEBUFFER_*
RPISENSE_FRAMEBUFFER_DESCRIPTION = 'Raspberry Pi Sense HAT Framebuffer';
|
Description of RPiSense framebuffer device |
RPISENSE_PHYSICAL_WIDTH = 8;
|
|
RPISENSE_PHYSICAL_HEIGHT = 8;
|
RPISENSE_JOYSTICK_*
RPISENSE_JOYSTICK_DESCRIPTION = 'Raspberry Pi Sense HAT Joystick';
|
Description of RPiSense joystick device |
RPISENSE_JOYSTICK_KEYMAP:array[0..4] of Word = (
| |
SCAN_CODE_DOWN_ARROW,
|
|
SCAN_CODE_RIGHT_ARROW,
|
|
SCAN_CODE_UP_ARROW,
|
|
SCAN_CODE_ENTER,
|
|
SCAN_CODE_LEFT_ARROW
|
RPISENSE_FB*
RPISENSE_FB = $00;
|
|
RPISENSE_WAI = $F0;
|
|
RPISENSE_VER = $F1;
|
|
RPISENSE_KEYS = $F2;
|
|
RPISENSE_EE_WP = $F3;
|
RPISENSE_GAMMA_*
RPISENSE_GAMMA_VALUES_DEFAULT = 0;
|
|
RPISENSE_GAMMA_VALUES_LOW = 1;
|
|
RPISENSE_GAMMA_VALUES_USER = 2;
|
Type definitions
RPi sense
PRPiSense = ^TRPiSense;
TRPiSense = record
Signature:LongWord;
|
Signature for entry validation |
I2C:PI2CDevice;
|
I2C device |
GPIO:PGPIODevice;
|
GPIO device |
Framebuffer:PFramebufferDevice;
|
Framebuffer device |
Joystick:PKeyboardDevice;
|
Joystick (Keyboard) device |
RPi sense gamma
PRPiSenseGamma = ^TRPiSenseGamma;
TRPiSenseGamma = array[0..31] of Byte;
RPi sense framebuffer
PRPiSenseFramebuffer = ^TRPiSenseFramebuffer;
TRPiSenseFramebuffer = record
Framebuffer Properties | |
Framebuffer:TFramebufferDevice;
|
|
RPiSense Properties | |
I2C:PI2CDevice;
|
The I2C device the device is connected to |
Width:LongWord;
|
Framebuffer Width in Pixels (Virtual) |
Height:LongWord;
|
Framebuffer Height in Pixels (Virtual) |
Rotation:LongWord;
|
Framebuffer Rotation (eg FRAMEBUFFER_ROTATION_180) |
DirtyY1:LongWord;
|
First line of dirty region (or Height - 1 if none dirty) |
DirtyY2:LongWord;
|
Last line of dirty region (or 0 if none dirty) |
Ready:LongBool;
|
If True timer should be enabled during Mark operation |
Blank:LongBool;
|
If True then display is currently blanked |
Lock:TMutexHandle;
|
Lock for dirty region redraw |
Timer:TTimerHandle;
|
Handle for dirty region redraw timer |
FrameRate:LongWord;
|
Frame rate for display refresh (in Frames Per Second) |
Gamma:TRPiSenseGamma;
|
Current gamma values |
GammaUser:TRPiSenseGamma;
|
User gamma values |
PixelData:array[0..63] of Word;
|
Pixel data for framebuffer update |
BlockData:array[0..192] of Byte;
|
Block data for display update |
RPi sense joystick
PRPiSenseJoystick = ^TRPiSenseJoystick;
TRPiSenseJoystick = record
Keyboard Properties | |
Keyboard:TKeyboardDevice;
|
|
RPiSense Properties | |
I2C:PI2CDevice;
|
The I2C device the device is connected to |
GPIO:PGPIODevice;
|
The GPIO device the device is connected to |
Pin:LongWord;
|
The GPIO pin used to signal joystick events (GPIO_PIN_23) |
Trigger:LongWord;
|
The GPIO trigger to detect joystick events (GPIO_TRIGGER_RISING) |
PreviousKeys:LongInt;
|
The keys pressed on the last GPIO event callback |
Statistics Properties | |
CallbackCount:LongWord;
|
Number of callback requests received by the device |
Public variables
RPiSenseHat specific variables
RPISENSE_I2C_DEVICE:String = 'I2C0';
|
RPISENSE_GPIO_DEVICE:String = 'GPIO0';
|
RPISENSE_FRAMEBUFFER_ROTATION:LongWord = FRAMEBUFFER_ROTATION_0;
|
RPISENSE_FRAMEBUFFER_WIDTH:LongWord = RPISENSE_PHYSICAL_WIDTH;
|
RPISENSE_FRAMEBUFFER_HEIGHT:LongWord = RPISENSE_PHYSICAL_HEIGHT;
|
RPISENSE_I2C_ADDRESS:Word = $46;
|
RPISENSE_LSM9DS1_MAGN_ADDRESS:Word = $1C;
|
RPISENSE_LSM9DS1_ACCEL_ADDRESS:Word = $6A;
|
RPISENSE_LPS25H_PRESS_ADDRESS:Word = $5C;
|
RPISENSE_HTS221_HUMID_ADDRESS:Word = $5F;
|
Function declarations
Initialization functions
procedure RPiSenseInit;
Note | Called only during system startup |
---|
function RPiSenseStart(const I2CDevice,GPIODevice:String; Rotation,Width,Height:LongWord):THandle;
I2C | The name of the I2C device that the Sense HAT is connected to |
---|---|
GPIO | The name of the GPIO device that the Sense HAT is connected to |
Rotation | The rotation value of the framebuffer (eg FRAMEBUFFER_ROTATION_180) |
Width | The width of the framebuffer in pixels (Virtual width only, the Physical width is fixed at 8 pixels) |
Height | The height of the framebuffer in pixels (Virtual height only, the Physical height is fixed at 8 pixels) |
Return | The handle of the RPiSenseHat on success or INVALID_HANDLE_VALUE on failure |
Note | This function will be called during startup if the parameter RPISENSE_AUTOSTART is True |
function RPiSenseStop(Handle:THandle):Boolean;
Handle | The handle of the RPiSenseHat or INVALID_HANDLE_VALUE for the default |
---|---|
Return | True if completed or False on failure |
RPiSenseHat framebuffer functions
function RPiSenseFramebufferCreate(I2C:PI2CDevice; const Name:String; Rotation,Width,Height:LongWord):PFramebufferDevice;
I2C | The I2C device that the RPiSenseHat is connected to |
---|---|
Name | The text description of this device which will show in the device list (Optional) |
Rotation | The rotation value of the framebuffer (eg FRAMEBUFFER_ROTATION_180) |
Width | The width of the framebuffer in pixels (Virtual width only, the Physical width is fixed at 8 pixels) |
Height | The height of the framebuffer in pixels (Virtual height only, the Physical height is fixed at 8 pixels) |
Return | Pointer to the new Framebuffer device or nil if the framebuffer device could not be created |
function RPiSenseFramebufferDestroy(Framebuffer:PFramebufferDevice):LongWord;
Framebuffer | The Framebuffer device to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function RPiSenseFramebufferAllocate(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Note | Not intended to be called directly by applications, use FramebufferDeviceAllocate instead. |
---|
function RPiSenseFramebufferRelease(Framebuffer:PFramebufferDevice):LongWord;
Note | Not intended to be called directly by applications, use FramebufferDeviceRelease instead. |
---|
function RPiSenseFramebufferBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Note | Not intended to be called directly by applications, use FramebufferDevicBlank instead. |
---|
function RPiSenseFramebufferMark(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Flags:LongWord):LongWord;
Note | Not intended to be called directly by applications, use FramebufferDeviceMark instead.
Marks full lines only, X and Width are ignored for RPiSenseHat Framebuffer |
---|
function RPiSenseFramebufferCommit(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags:LongWord):LongWord;
Note | Not intended to be called directly by applications, use FramebufferDeviceCommit instead. |
---|
function RPiSenseFramebufferSetOffset(Framebuffer:PFramebufferDevice; X,Y:LongWord; Pan:Boolean):LongWord;
Note | Not intended to be called directly by applications, use FramebufferDeviceSetOffset instead. |
---|
function RPiSenseFramebufferGetGamma(Framebuffer:PFramebufferDevice; var Gamma:TRPiSenseGamma):LongWord;
Framebuffer | The Framebuffer device to get from |
---|---|
Gamma | An array of gamma values returned on completion |
Return | ERROR_SUCCESS if completed or another error code on failure |
function RPiSenseFramebufferSetGamma(Framebuffer:PFramebufferDevice; const Gamma:TRPiSenseGamma):LongWord;
Framebuffer | The Framebuffer device to set for |
---|---|
Gamma | An array of gamma values to set |
Return | ERROR_SUCCESS if completed or another error code on failure |
function RPiSenseFramebufferResetGamma(Framebuffer:PFramebufferDevice; Value:LongWord):LongWord;
Framebuffer | The Framebuffer device to set for |
---|---|
Value | The gamma values to set (0 = Default / 1 = Low / 2 = User) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function RPiSenseFramebufferSetRotation(Framebuffer:PFramebufferDevice; Rotation:LongWord):LongWord;
Note | None documented |
---|
procedure RPiSenseFramebufferUpdateDisplay(Framebuffer:PRPiSenseFramebuffer);
Note | Not intended to be called directly by applications |
---|
RPiSenseHat joystick functions
function RPiSenseJoystickCreate(I2C:PI2CDevice; GPIO:PGPIODevice; const Name:String):PKeyboardDevice;
I2C | The I2C device that the RPiSenseHat is connected to |
---|---|
GPIO | The GPIO device that the RPiSenseHat is connected to |
Name | The text description of this device which will show in the device list (Optional) |
Return | Pointer to the new Joystick (Keyboard) device or nil if the device could not be created |
function RPiSenseJoystickDestroy(Joystick:PKeyboardDevice):LongWord;
Joystick | The Joystick (Keyboard) device to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
procedure RPiSenseJoystickCallback(Joystick:PRPiSenseJoystick; Pin,Trigger:LongWord);
Note | Not intended to be called directly by applications |
---|
RPiSenseHat helper functions
function RPiSenseRegRead(I2C:PI2CDevice; Address:Word; Reg:Byte):LongInt;
I2C | The I2C device the RPiSenseHat is connected to |
---|---|
Address | The I2C address of the RPiSenseHat |
Reg | The register to read |
Return | The register value on success or -1 on failure |
function RPiSenseBlockWrite(I2C:PI2CDevice; Address:Word; Data:PByte; Size:Integer):LongWord;
I2C | The I2C device the RPiSenseHat is connected to |
---|---|
Address | The I2C address of the RPiSenseHat |
Data | Pointer to the data block to be written |
Size | Size of the data block in bytes |
Return | ERROR_SUCCESS if completed or another error code on failure |
Return to Unit Reference