RTEMS  5.1
vc.h
Go to the documentation of this file.
1 
10 /*
11  * Copyright (c) 2015 Yang Qiao
12  *
13  * The license and distribution terms for this file may be
14  * found in the file LICENSE in this distribution or at
15  *
16  * http://www.rtems.org/license/LICENSE
17  *
18  */
19 
20 #ifndef LIBBSP_ARM_RASPBERRYPI_VC_H
21 #define LIBBSP_ARM_RASPBERRYPI_VC_H
22 
33 typedef struct {
34  uint32_t width;
35  uint32_t height;
37 
38 int bcm2835_mailbox_get_display_size(
40 
41 typedef enum {
42  bcm2835_mailbox_pixel_order_bgr = 0,
43  bcm2835_mailbox_pixel_order_rgb = 1
44 } bcm2835_pixel_order;
45 
46 typedef enum {
47  bcm2835_mailbox_alpha_mode_0_opaque = 0,
48  bcm2835_mailbox_alpha_mode_0_transparent = 1,
49  bcm2835_mailbox_alpha_mode_ignored = 2
50 } bcm2835_alpha_mode;
51 
52 typedef struct {
53  uint32_t xres;
54  uint32_t yres;
55  uint32_t xvirt;
56  uint32_t yvirt;
57  uint32_t depth;
58  bcm2835_pixel_order pixel_order;
59  bcm2835_alpha_mode alpha_mode;
60  uint32_t voffset_x;
61  uint32_t voffset_y;
62  uint32_t overscan_left;
63  uint32_t overscan_right;
64  uint32_t overscan_top;
65  uint32_t overscan_bottom;
66  uint32_t base;
67  size_t size;
68  uint32_t pitch;
70 
71 int bcm2835_mailbox_init_frame_buffer(
73 
74 typedef struct {
75  uint32_t pitch;
77 
78 int bcm2835_mailbox_get_pitch( bcm2835_get_pitch_entries *_entries );
79 
80 typedef struct {
81  char cmdline[ 1024 ];
83 
84 int bcm2835_mailbox_get_cmdline( bcm2835_get_cmdline_entries *_entries );
85 
86 typedef enum {
87  bcm2835_mailbox_power_udid_sd_card = 0x00000000u,
88  bcm2835_mailbox_power_udid_uart0 = 0x00000001u,
89  bcm2835_mailbox_power_udid_uart1 = 0x00000002u,
90  bcm2835_mailbox_power_udid_usb_hcd = 0x00000003u,
91  bcm2835_mailbox_power_udid_i2c0 = 0x00000004u,
92  bcm2835_mailbox_power_udid_i2c1 = 0x00000005u,
93  bcm2835_mailbox_power_udid_i2c2 = 0x00000006u,
94  bcm2835_mailbox_power_udid_spi = 0x00000007u,
95  bcm2835_mailbox_power_udid_ccp2tx = 0x00000008u,
96 } bcm2835_power_device_id;
97 
98 typedef struct {
99  bcm2835_power_device_id dev_id;
100  uint32_t state;
102 
103 #define BCM2835_MAILBOX_SET_POWER_STATE_REQ_ON ( 1 << 0 )
104 #define BCM2835_MAILBOX_SET_POWER_STATE_REQ_WAIT ( 1 << 1 )
105 #define BCM2835_MAILBOX_POWER_STATE_ON ( 1 << 0 )
106 #define BCM2835_MAILBOX_POWER_STATE_NODEV ( 1 << 1 )
107 int bcm2835_mailbox_set_power_state( bcm2835_set_power_state_entries *_entries );
108 
109 int bcm2835_mailbox_get_power_state( bcm2835_set_power_state_entries *_entries );
110 
111 typedef struct {
112  uint32_t base;
113  size_t size;
115 
116 int bcm2835_mailbox_get_arm_memory( bcm2835_get_arm_memory_entries *_entries );
117 
118 typedef struct {
119  uint32_t base;
120  size_t size;
122 
123 int bcm2835_mailbox_get_vc_memory( bcm2835_get_vc_memory_entries *_entries );
124 
125 typedef struct {
126  uint32_t fw_rev;
128 
129 int bcm2835_mailbox_get_firmware_revision(
131 
132 typedef struct {
133  uint32_t spec;
135 
136 int bcm2835_mailbox_get_board_model( bcm2835_get_board_spec_entries *_entries );
137 
138 int bcm2835_mailbox_get_board_revision(
139  bcm2835_get_board_spec_entries *_entries );
140 
141 /*
142  * See the official documentation for the format of the revision codes:
143  * https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
144  */
145 #define BCM2835_REVISION_IS_NEW_STYLE(revision) ((revision & (1 << 23)) != 0)
146 #define BCM2835_REVISION_MEMORY_SIZE(revision) ((revision >> 20) & 0x7)
147 #define BCM2835_REVISION_MANUFACTURER(revision) ((revision >> 16) & 0xf)
148 #define BCM2835_REVISION_PROCESSOR(revision) ((revision >> 12) & 0xf)
149 #define BCM2835_REVISION_TYPE(revision) ((revision >> 4) & 0xff)
150 #define BCM2835_REVISION_REVISION(revision) ((revision >> 0) & 0xf)
151 
152 typedef struct {
153  uint64_t board_serial;
155 
156 int bcm2835_mailbox_get_board_serial(
158 
159 typedef struct {
160  uint32_t clock_id;
161  uint32_t clock_rate;
163 
164 int bcm2835_mailbox_get_clock_rate(
165  bcm2835_get_clock_rate_entries *_entries );
168 #endif /* LIBBSP_ARM_RASPBERRYPI_VC_H */
Definition: vc.h:118
Definition: vc.h:111
Definition: vc.h:74
Definition: vc.h:80
Definition: vc.h:132
Definition: vc.h:159
unsigned size
Definition: tte.h:74