Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
rpisensehat.h File Reference
#include "ultibo/gpio.h"
#include "ultibo/i2c.h"
#include "ultibo/keyboard.h"
#include "ultibo/framebuffer.h"

Go to the source code of this file.

Data Structures

struct  _RPISENSE
struct  _RPISENSE_FRAMEBUFFER
struct  _RPISENSE_JOYSTICK

Macros

#define RPISENSE_SIGNATURE   0xEAEBECED
#define RPISENSE_FRAMEBUFFER_DESCRIPTION   "Raspberry Pi Sense HAT Framebuffer"
 Description of RPiSense framebuffer device.
#define RPISENSE_PHYSICAL_WIDTH   8
#define RPISENSE_PHYSICAL_HEIGHT   8
#define RPISENSE_JOYSTICK_DESCRIPTION   "Raspberry Pi Sense HAT Joystick"
 Description of RPiSense joystick device.
#define RPISENSE_FB   0x00
#define RPISENSE_WAI   0xF0
#define RPISENSE_VER   0xF1
#define RPISENSE_KEYS   0xF2
#define RPISENSE_EE_WP   0xF3
#define RPISENSE_GAMMA_VALUES_DEFAULT   0
#define RPISENSE_GAMMA_VALUES_LOW   1
#define RPISENSE_GAMMA_VALUES_USER   2

Typedefs

typedef struct _RPISENSE RPISENSE
typedef struct _RPISENSE_FRAMEBUFFER RPISENSE_FRAMEBUFFER
typedef struct _RPISENSE_JOYSTICK RPISENSE_JOYSTICK

Functions

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 framebuffer API.
BOOL STDCALL rpisense_stop (HANDLE handle)
 Release, deregister and destroy an RPiSenseHat Framebuffer device created by this driver.

Macro Definition Documentation

◆ RPISENSE_SIGNATURE

#define RPISENSE_SIGNATURE   0xEAEBECED

RPiSenseHat specific constants

◆ RPISENSE_FRAMEBUFFER_DESCRIPTION

#define RPISENSE_FRAMEBUFFER_DESCRIPTION   "Raspberry Pi Sense HAT Framebuffer"

Description of RPiSense framebuffer device.

Framebuffer

◆ RPISENSE_PHYSICAL_WIDTH

#define RPISENSE_PHYSICAL_WIDTH   8

◆ RPISENSE_PHYSICAL_HEIGHT

#define RPISENSE_PHYSICAL_HEIGHT   8

◆ RPISENSE_JOYSTICK_DESCRIPTION

#define RPISENSE_JOYSTICK_DESCRIPTION   "Raspberry Pi Sense HAT Joystick"

Description of RPiSense joystick device.

Joystick

◆ RPISENSE_FB

#define RPISENSE_FB   0x00

RPiSenseHat register values

◆ RPISENSE_WAI

#define RPISENSE_WAI   0xF0

◆ RPISENSE_VER

#define RPISENSE_VER   0xF1

◆ RPISENSE_KEYS

#define RPISENSE_KEYS   0xF2

◆ RPISENSE_EE_WP

#define RPISENSE_EE_WP   0xF3

◆ RPISENSE_GAMMA_VALUES_DEFAULT

#define RPISENSE_GAMMA_VALUES_DEFAULT   0

RPiSenseHat gamma reset values

◆ RPISENSE_GAMMA_VALUES_LOW

#define RPISENSE_GAMMA_VALUES_LOW   1

◆ RPISENSE_GAMMA_VALUES_USER

#define RPISENSE_GAMMA_VALUES_USER   2

Typedef Documentation

◆ RPISENSE

typedef struct _RPISENSE RPISENSE

RPiSenseHat specific types

◆ RPISENSE_FRAMEBUFFER

◆ RPISENSE_JOYSTICK

Function Documentation

◆ rpisense_start()

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 framebuffer API.

RPiSenseHat Functions

Parameters
I2CThe I2C device that the RPiSenseHat is connected to
NameThe text description of this device which will show in the device list (Optional)
RotationThe rotation value of the framebuffer (eg FRAMEBUFFER_ROTATION_180)
WidthThe width of the framebuffer in pixels (Virtual width only, the Physical width is fixed at 8 pixels)
HeightThe height of the framebuffer in pixels (Virtual height only, the Physical height is fixed at 8 pixels)
Returns
Pointer to the new Framebuffer device or nil if the framebuffer device could not be created

◆ rpisense_stop()

BOOL STDCALL rpisense_stop ( HANDLE handle)

Release, deregister and destroy an RPiSenseHat Framebuffer device created by this driver.

Parameters
FramebufferThe Framebuffer device to destroy
Returns
ERROR_SUCCESS if completed or another error code on failure