-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframebuffer.h
More file actions
43 lines (35 loc) · 1.07 KB
/
framebuffer.h
File metadata and controls
43 lines (35 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __PI_SENSE_FRAMEBUFFER
#define __PI_SENSE_FRAMEBUFFER
#include <stdint.h>
#include <linux/fb.h>
typedef struct {
uint16_t pixel[8][8];
} sense_fb_bitmap_t;
typedef struct{
int fd;
struct fb_fix_screeninfo info;
sense_fb_bitmap_t* bitmap;
} pi_framebuffer_t;
/*getFBDevice
returns a pi_framebuffer_t object describing the sense hat frame buffer, or null on failure
Note: function allocates a pi_framebuffer_t object on success which must be freed with a call to freeFrameBuffer()
*/
pi_framebuffer_t* getFBDevice();
/*freeFrameBuffer
frees and unmaps a previously allocated frame buffer
*/
void freeFrameBuffer(pi_framebuffer_t* device);
/*clearBitmap
bitmap: a bitmap object to modify
color: the fill color for the bitmap
Fills the bitmap with the color
*/
void clearBitmap(sense_fb_bitmap_t* bitmap,uint16_t color);
/*getColor
red: the 8 bit red component
green: the 8 bit green component
blue: the 8 bit blue component
returns a 16 bit representation of the 32 bit color specified by the arguments
*/
uint16_t getColor(int red,int green,int blue);
#endif