-
Notifications
You must be signed in to change notification settings - Fork 43
/
mailbox.h
57 lines (44 loc) · 1.21 KB
/
mailbox.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef MAILBOX_H
#define MAILBOX_H
#include <stdint.h>
typedef struct {
uint32_t width;
uint32_t height;
} __attribute__((packed)) FbScreenSize;
typedef struct {
uint32_t clockId;
uint32_t rate;
uint32_t skipTurbo;
} __attribute__((packed)) ClockRateSetInfo;
typedef struct {
uint32_t base;
uint32_t size;
} __attribute__((packed)) FbAllocateRes;
typedef struct {
uint32_t clockId;
uint32_t rate;
} __attribute__((packed)) ClockRateRes;
typedef union {
FbScreenSize fbScreenSize;
uint32_t fbBitsPerPixel;
uint32_t fbAllocateAlignment;
uint32_t clockId;
ClockRateSetInfo clockRateSetInfo;
FbAllocateRes fbAllocateRes;
ClockRateRes clockRateRes;
} ValueBuffer;
#define NULL_TAG 0
#define FB_ALLOCATE_TAG 0x00040001
#define FB_SET_PHYSICAL_SIZE 0x00048003
#define FB_SET_VIRTUAL_SIZE 0x00048004
#define FB_SET_DEPTH 0x00048005
#define CLOCK_GET_MAX_RATE 0x00030004
#define CLOCK_SET_RATE 0x00038002
typedef struct {
uint32_t tag;
ValueBuffer value;
} __attribute__((packed)) PropertyMessageTag;
uint32_t mailbox_read(uint8_t channel);
void mailbox_write(uint8_t channel, uint32_t data);
int mailbox_send_messages(PropertyMessageTag *tags);
#endif // MAILBOX_H