Unit RPISENSEHAT

From Ultibo.org
Revision as of 04:27, 28 March 2018 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


Description


Raspberry Pi SenstHat Driver unit

The SenseHAT 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 SenseHAT 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 SenseHAT 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



[Expand]
RPiSenseHat specific constants RPISENSE_*


[Expand]
Framebuffer RPISENSE_FRAMEBUFFER_*


[Expand]
Joystick RPISENSE_JOYSTICK_*


[Expand]
RPiSenseHat register value RPISENSE_FB*


[Expand]
RPiSenseHat gamma reset value RPISENSE_GAMMA_*


Type definitions



RPi sense

[Expand]

PRPiSense = ^TRPiSense;

TRPiSense = record

RPi sense gamma

[Expand]

PRPiSenseGamma = ^TRPiSenseGamma;

TRPiSenseGamma = array[0..31] of Byte;

RPi sense framebuffer

[Expand]

PRPiSenseFramebuffer = ^TRPiSenseFramebuffer;

TRPiSenseFramebuffer = record

RPi sense joystick

[Expand]

PRPiSenseJoystick = ^TRPiSenseJoystick;

TRPiSenseJoystick = record


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


To be documented


Return to Unit Reference