26#ifndef _ULTIBO_RPISENSEHAT_H
27#define _ULTIBO_RPISENSEHAT_H
39#define RPISENSE_SIGNATURE 0xEAEBECED
42#define RPISENSE_FRAMEBUFFER_DESCRIPTION "Raspberry Pi Sense HAT Framebuffer"
44#define RPISENSE_PHYSICAL_WIDTH 8
45#define RPISENSE_PHYSICAL_HEIGHT 8
48#define RPISENSE_JOYSTICK_DESCRIPTION "Raspberry Pi Sense HAT Joystick"
50static const uint16_t RPISENSE_JOYSTICK_KEYMAP[5] = {
58#define RPISENSE_FB 0x00
59#define RPISENSE_WAI 0xF0
60#define RPISENSE_VER 0xF1
61#define RPISENSE_KEYS 0xF2
62#define RPISENSE_EE_WP 0xF3
65#define RPISENSE_GAMMA_VALUES_DEFAULT 0
66#define RPISENSE_GAMMA_VALUES_LOW 1
67#define RPISENSE_GAMMA_VALUES_USER 2
struct _FRAMEBUFFER_DEVICE FRAMEBUFFER_DEVICE
Definition framebuffer.h:112
#define SCAN_CODE_RIGHT_ARROW
Keyboard Right Arrow.
Definition globalconst.h:654
#define SCAN_CODE_UP_ARROW
Keyboard Up Arrow.
Definition globalconst.h:657
#define SCAN_CODE_DOWN_ARROW
Keyboard Down Arrow.
Definition globalconst.h:656
#define SCAN_CODE_ENTER
Keyboard Enter).
Definition globalconst.h:615
#define SCAN_CODE_LEFT_ARROW
Keyboard Left Arrow.
Definition globalconst.h:655
int32_t LONGBOOL
Compatibility with FPC LongBool type (4 bytes).
Definition globaltypes.h:56
size_t HANDLE
Definition globaltypes.h:51
#define STDCALL
Definition globaltypes.h:45
_Bool BOOL
Built in Boolean type (1 byte) (Redeclared here for flexibility).
Definition globaltypes.h:55
HANDLE TIMER_HANDLE
Definition globaltypes.h:119
HANDLE MUTEX_HANDLE
Definition globaltypes.h:105
struct _GPIO_DEVICE GPIO_DEVICE
Forward declared for GPIOPin.
Definition gpio.h:85
struct _I2C_DEVICE I2C_DEVICE
Definition i2c.h:81
struct _KEYBOARD_DEVICE KEYBOARD_DEVICE
Definition keyboard.h:203
struct _RPISENSE_JOYSTICK RPISENSE_JOYSTICK
Definition rpisensehat.h:104
HANDLE STDCALL rpisense_start(char *i2cdevice, char *gpiodevice, uint32_t rotation, uint32_t width, uint32_t height)
Create, register and allocate a new RPiSenseHat Framebuffer device which can be accessed using the fr...
BOOL STDCALL rpisense_stop(HANDLE handle)
Release, deregister and destroy an RPiSenseHat Framebuffer device created by this driver.
struct _RPISENSE_FRAMEBUFFER RPISENSE_FRAMEBUFFER
Definition rpisensehat.h:80
struct _RPISENSE RPISENSE
Definition rpisensehat.h:70
Definition rpisensehat.h:82
uint8_t gamma[32]
Current gamma values.
Definition rpisensehat.h:97
MUTEX_HANDLE lock
Lock for dirty region redraw.
Definition rpisensehat.h:94
uint8_t gammauser[32]
User gamma values.
Definition rpisensehat.h:98
I2C_DEVICE * i2c
The I2C device the device is connected to.
Definition rpisensehat.h:86
uint32_t width
Framebuffer Width in Pixels (Virtual).
Definition rpisensehat.h:87
uint32_t height
Framebuffer Height in Pixels (Virtual).
Definition rpisensehat.h:88
uint32_t framerate
Frame rate for display refresh (in Frames Per Second).
Definition rpisensehat.h:96
uint8_t blockdata[193]
Block data for display update.
Definition rpisensehat.h:100
LONGBOOL ready
If True timer should be enabled during Mark operation.
Definition rpisensehat.h:92
uint16_t pixeldata[64]
Pixel data for framebuffer update.
Definition rpisensehat.h:99
FRAMEBUFFER_DEVICE framebuffer
Definition rpisensehat.h:84
LONGBOOL blank
If True then display is currently blanked.
Definition rpisensehat.h:93
uint32_t rotation
Framebuffer Rotation (eg FRAMEBUFFER_ROTATION_180).
Definition rpisensehat.h:89
uint32_t dirtyy2
Last line of dirty region (or 0 if none dirty).
Definition rpisensehat.h:91
TIMER_HANDLE timer
Handle for dirty region redraw timer.
Definition rpisensehat.h:95
uint32_t dirtyy1
First line of dirty region (or Height - 1 if none dirty).
Definition rpisensehat.h:90
Definition rpisensehat.h:106
GPIO_DEVICE * gpio
The GPIO device the device is connected to.
Definition rpisensehat.h:111
uint32_t pin
The GPIO pin used to signal joystick events (GPIO_PIN_23).
Definition rpisensehat.h:112
I2C_DEVICE * i2c
The I2C device the device is connected to.
Definition rpisensehat.h:110
uint32_t callbackcount
Number of callback requests received by the device.
Definition rpisensehat.h:116
KEYBOARD_DEVICE keyboard
Definition rpisensehat.h:108
int32_t previouskeys
The keys pressed on the last GPIO event callback.
Definition rpisensehat.h:114
uint32_t trigger
The GPIO trigger to detect joystick events (GPIO_TRIGGER_RISING).
Definition rpisensehat.h:113
Definition rpisensehat.h:72
GPIO_DEVICE * gpio
GPIO device.
Definition rpisensehat.h:75
I2C_DEVICE * i2c
I2C device.
Definition rpisensehat.h:74
FRAMEBUFFER_DEVICE * framebuffer
Framebuffer device.
Definition rpisensehat.h:76
KEYBOARD_DEVICE * joystick
Joystick (Keyboard) device.
Definition rpisensehat.h:77
uint32_t signature
Signature for entry validation.
Definition rpisensehat.h:73