dev_fb.h Source File

Back to the index.

dev_fb.h
Go to the documentation of this file.
1 #ifndef TESTMACHINE_FB_H
2 #define TESTMACHINE_FB_H
3 
4 /*
5  * Definitions used by the framebuffer device in GXemul.
6  *
7  * This file is in the public domain.
8  */
9 
10 
11 /* Physical base address for linear framebuffer memory: */
12 #define DEV_FB_ADDRESS 0x12000000
13 
14 /* Physical base address for the framebuffer controller: */
15 #define DEV_FBCTRL_ADDRESS 0x12f00000
16 #define DEV_FBCTRL_LENGTH 0x20
17 
18 
19 /*
20  * First choose the port by writing the port index to DEV_FBCTRL_PORT,
21  * then read or write DEV_FBCTRL_DATA.
22  */
23 
24 #define DEV_FBCTRL_PORT 0x00
25 #define DEV_FBCTRL_DATA 0x10
26 
27 #define DEV_FBCTRL_PORT_COMMAND 0
28 #define DEV_FBCTRL_PORT_X1 1
29 #define DEV_FBCTRL_PORT_Y1 2
30 #define DEV_FBCTRL_PORT_X2 3
31 #define DEV_FBCTRL_PORT_Y2 4
32 #define DEV_FBCTRL_PORT_COLOR_R 5
33 #define DEV_FBCTRL_PORT_COLOR_G 6
34 #define DEV_FBCTRL_PORT_COLOR_B 7
35 #define DEV_FBCTRL_NPORTS 8
36 
37 
38 /*
39  * Controller commands:
40  */
41 
42 /* Do nothing. */
43 #define DEV_FBCTRL_COMMAND_NOP 0
44 
45 /* Set resolution to X1 x Y1. */
46 #define DEV_FBCTRL_COMMAND_SET_RESOLUTION 1
47 
48 /* Get current resolution into X1, Y1. */
49 #define DEV_FBCTRL_COMMAND_GET_RESOLUTION 2
50 
51 /* TODO: */
52 #define DEV_FBCTRL_COMMAND_FILL 3
53 #define DEV_FBCTRL_COMMAND_COPY 4
54 
55 
56 #define DEV_FBCTRL_MAXY(x) (((DEV_FBCTRL_ADDRESS-DEV_FB_ADDRESS) / 3) / x)
57 
58 #endif /* TESTMACHINE_FB_H */

Generated on Fri Dec 7 2018 19:52:23 for GXemul by doxygen 1.8.13