RTEMS: bsps/arm/raspberrypi/include/bsp/vc.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
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;
36} bcm2835_get_display_size_entries;
37
38int bcm2835_mailbox_get_display_size(
39 bcm2835_get_display_size_entries *_entries );
40
41typedef enum {
42 bcm2835_mailbox_pixel_order_bgr = 0,
43 bcm2835_mailbox_pixel_order_rgb = 1
44} bcm2835_pixel_order;
45
46typedef 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;
69} bcm2835_init_frame_buffer_entries;
70
71int bcm2835_mailbox_init_frame_buffer(
72 bcm2835_init_frame_buffer_entries *_entries );
73
74 typedef struct {
75 uint32_t pitch;
76} bcm2835_get_pitch_entries;
77
78int bcm2835_mailbox_get_pitch( bcm2835_get_pitch_entries *_entries );
79
80 typedef struct {
81 char cmdline[ 1024 ];
82} bcm2835_get_cmdline_entries;
83
84int bcm2835_mailbox_get_cmdline( bcm2835_get_cmdline_entries *_entries );
85
86typedef 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;
101} bcm2835_set_power_state_entries;
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 )
107int bcm2835_mailbox_set_power_state( bcm2835_set_power_state_entries *_entries );
108
109int bcm2835_mailbox_get_power_state( bcm2835_set_power_state_entries *_entries );
110
111 typedef struct {
112 uint32_t base;
113 size_t size;
114} bcm2835_get_arm_memory_entries;
115
116int bcm2835_mailbox_get_arm_memory( bcm2835_get_arm_memory_entries *_entries );
117
118 typedef struct {
119 uint32_t base;
120 size_t size;
121} bcm2835_get_vc_memory_entries;
122
123int bcm2835_mailbox_get_vc_memory( bcm2835_get_vc_memory_entries *_entries );
124
125 typedef struct {
126 uint32_t fw_rev;
127} bcm2835_mailbox_get_fw_rev_entries;
128
129int bcm2835_mailbox_get_firmware_revision(
130 bcm2835_mailbox_get_fw_rev_entries *_entries );
131
132 typedef struct {
133 uint32_t spec;
134} bcm2835_get_board_spec_entries;
135
136int bcm2835_mailbox_get_board_model( bcm2835_get_board_spec_entries *_entries );
137
138int 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;
154} bcm2835_get_board_serial_entries;
155
156int bcm2835_mailbox_get_board_serial(
157 bcm2835_get_board_serial_entries *_entries );
158
159 typedef struct {
160 uint32_t clock_id;
161 uint32_t clock_rate;
162} bcm2835_get_clock_rate_entries;
163
164int bcm2835_mailbox_get_clock_rate(
165 bcm2835_get_clock_rate_entries *_entries );
168#endif /* LIBBSP_ARM_RASPBERRYPI_VC_H */
bcm2835_get_arm_memory_entries
Definition: vc.h:111
bcm2835_get_board_serial_entries
Definition: vc.h:152
bcm2835_get_board_spec_entries
Definition: vc.h:132
bcm2835_get_clock_rate_entries
Definition: vc.h:159
bcm2835_get_cmdline_entries
Definition: vc.h:80
bcm2835_get_display_size_entries
Definition: vc.h:33
bcm2835_get_pitch_entries
Definition: vc.h:74
bcm2835_get_vc_memory_entries
Definition: vc.h:118
bcm2835_init_frame_buffer_entries
Definition: vc.h:52
bcm2835_mailbox_get_fw_rev_entries
Definition: vc.h:125
bcm2835_set_power_state_entries
Definition: vc.h:98