Difference between revisions of "Unit RPISENSEHAT"

From Ultibo.org
Jump to: navigation, search
Line 18: Line 18:
 
----
 
----
  
''To be documented''
+
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPiSenseHat specific constants''' <code> RPISENSE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPISENSE_SIGNATURE = $EAEBECED;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Framebuffer''' <code> RPISENSE_FRAMEBUFFER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPISENSE_FRAMEBUFFER_DESCRIPTION = 'Raspberry Pi Sense HAT Framebuffer';</code>
 +
| Description of RPiSense framebuffer device
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>RPISENSE_PHYSICAL_WIDTH = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RPISENSE_PHYSICAL_HEIGHT = 8;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Joystick''' <code> RPISENSE_JOYSTICK_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPISENSE_JOYSTICK_DESCRIPTION = 'Raspberry Pi Sense HAT Joystick';</code>
 +
| Description of RPiSense joystick device
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<code>RPISENSE_JOYSTICK_KEYMAP:array[0..4] of Word = (</code>
 +
|-
 +
| <code>SCAN_CODE_DOWN_ARROW,</code>
 +
| &nbsp;
 +
|-
 +
| <code>SCAN_CODE_RIGHT_ARROW,</code>
 +
| &nbsp;
 +
|-
 +
| <code>SCAN_CODE_UP_ARROW,</code>
 +
| &nbsp;
 +
|-
 +
| <code>SCAN_CODE_ENTER,</code>
 +
| &nbsp;
 +
|-
 +
| <code>SCAN_CODE_LEFT_ARROW</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPiSenseHat register value''' <code>  RPISENSE_FB* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPISENSE_FB = $00;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>RPISENSE_WAI = $F0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RPISENSE_VER = $F1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RPISENSE_KEYS = $F2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RPISENSE_EE_WP = $F3;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''RPiSenseHat gamma reset value''' <code> RPISENSE_GAMMA_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>RPISENSE_GAMMA_VALUES_DEFAULT = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>RPISENSE_GAMMA_VALUES_LOW = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RPISENSE_GAMMA_VALUES_USER = 2;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===

Revision as of 03:41, 28 March 2018

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



RPiSenseHat specific constants RPISENSE_*
RPISENSE_SIGNATURE = $EAEBECED;  


Framebuffer RPISENSE_FRAMEBUFFER_*
RPISENSE_FRAMEBUFFER_DESCRIPTION = 'Raspberry Pi Sense HAT Framebuffer'; Description of RPiSense framebuffer device
 
RPISENSE_PHYSICAL_WIDTH = 8;  
RPISENSE_PHYSICAL_HEIGHT = 8;  


Joystick 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  


RPiSenseHat register value RPISENSE_FB*
RPISENSE_FB = $00;  
RPISENSE_WAI = $F0;  
RPISENSE_VER = $F1;  
RPISENSE_KEYS = $F2;  
RPISENSE_EE_WP = $F3;  


RPiSenseHat gamma reset value RPISENSE_GAMMA_*
RPISENSE_GAMMA_VALUES_DEFAULT = 0;  
RPISENSE_GAMMA_VALUES_LOW = 1;  
RPISENSE_GAMMA_VALUES_USER = 2;  


Type definitions


To be documented

Public variables


To be documented

Function declarations


To be documented


Return to Unit Reference