source: rtems/cpukit/libmisc/mw-fb/mw_fb.h @ f26145b

4.104.114.84.95
Last change on this file since f26145b was aed742c, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/16/04 at 12:06:28

Remove stray white spaces.

  • Property mode set to 100644
File size: 5.0 KB
Line 
1/*
2/////////////////////////////////////////////////////////////////////////////
3// $Header$
4//
5// Copyright (c) 2000 - Rosimildo da Silva
6//
7// MODULE DESCRIPTION:
8// Micro FrameBuffer interface for Embedded Systems.
9//
10// MODIFICATION/HISTORY:
11//
12// $Log$
13// Revision 1.1  2000/08/30 08:21:24  joel
14// 2000-08-26  Rosimildo da Silva  <rdasilva@connecttel.com>
15//
16//      * Added generic Micro FrameBuffer interface for MicroWindows.
17//      This interface allows MicroWindows to under RTEMS. A sample
18//      driver has been developed for the pc386 BSP. See
19//      pc386/fb_vga.c as a sample.
20//      * Added Uniform Input Device interface for MicroWindows.
21//      See PC386 bsp for sample drivers for mouse and keyboard (console).
22//      * mw-bf: New directory.
23//      * Makefile.am, configure.in, wrapup/Makefile.am: Account for mw-fb.
24//      * mw-fb/Makefile.am: New file.
25//      * mw-fb/mw_fb.c: New file.
26//      * mw-fb/mw_fb.h: New file.
27//      * mw-fb/mw_uid.c: New file.
28//      * mw-fb/mw_uid.h: New file.
29//
30//
31/////////////////////////////////////////////////////////////////////////////
32*/
33#ifndef _MW_FB_H
34#define _MW_FB_H
35
36#ifdef  __cplusplus
37extern "C" {
38#endif
39
40/* ioctls
41   0x46 is 'F'                                */
42#define FB_SCREENINFO             0x4601
43#define FB_GETPALETTE             0x4602
44#define FB_SETPALETTE             0x4603
45#define FB_EXEC_FUNCTION          0x4604
46
47
48#define FB_TYPE_PACKED_PIXELS          0    /* Packed Pixels    */
49#define FB_TYPE_PLANES                 1    /* Non interleaved planes */
50#define FB_TYPE_INTERLEAVED_PLANES     2    /* Interleaved planes    */
51#define FB_TYPE_TEXT                   3    /* Text/attributes    */
52#define FB_TYPE_VGA_PLANES             4    /* EGA/VGA planes    */
53#define FB_TYPE_VIRTUAL_BUFFER         5    /* Virtual Buffer */
54
55
56#define FB_VISUAL_MONO01               0    /* Monochr. 1=Black 0=White */
57#define FB_VISUAL_MONO10               1    /* Monochr. 1=White 0=Black */
58#define FB_VISUAL_TRUECOLOR            2    /* True color    */
59#define FB_VISUAL_PSEUDOCOLOR          3    /* Pseudo color (like atari) */
60#define FB_VISUAL_DIRECTCOLOR          4    /* Direct color */
61#define FB_VISUAL_STATIC_PSEUDOCOLOR   5    /* Pseudo color readonly */
62
63#define FB_ACCEL_NONE                  0    /* no hardware accelerator    */
64
65/* no dependency on any other header file */
66typedef  unsigned long  __u32;
67typedef  unsigned short __u16;
68
69struct fb_screeninfo {
70    __u32 xres;                  /* visible resolution        */
71    __u32 yres;
72    __u32 bits_per_pixel;        /* guess what            */
73         __u32 line_length;          /* number of chars per line */
74     volatile char *smem_start; /* Start of frame buffer mem  */
75                                /* (physical address)         */
76    __u32 smem_len;             /* Length of frame buffer mem */
77    __u32 type;                 /* see FB_TYPE_*              */
78    __u32 visual;               /* see FB_VISUAL_*            */
79
80};
81
82struct fb_cmap {
83    __u32 start;                /* First entry    */
84    __u32 len;                  /* Number of entries */
85    __u16 *red;                 /* Red values    */
86    __u16 *green;
87    __u16 *blue;
88    __u16 *transp;              /* transparency, can be NULL */
89};
90
91/* type of function to be executed at the driver level */
92#define FB_FUNC_ENTER_GRAPHICS   0
93#define FB_FUNC_EXIT_GRAPHICS    1
94#define FB_FUNC_IS_DIRTY         2
95#define FB_FUNC_GET_MODE         3
96
97struct fb_exec_function
98{
99    int    func_no;
100    void  *param;
101};
102
103
104/* Micro Framebuffer API Wrapper */
105
106/*
107 * This function returns the information regarding the display.
108 * It is called just after the driver be opened to get all needed
109 * information about the driver. No change in the mode of operation
110 * of the driver is done with this call.
111 */
112extern int ufb_get_screen_info( int fd, struct fb_screeninfo *info );
113
114
115/*
116 * Returns the mode of the graphics subsystem
117 */
118extern int ufb_get_mode( int fd, int *mode );
119
120
121/*
122 * Returns the current collor pallete
123 */
124extern int ufb_get_palette( int fd, struct fb_cmap *color );
125
126/*
127 * Set the current collor pallete
128 */
129extern int ufb_set_palette( int fd, struct fb_cmap *color );
130
131/*
132 * Does all necessary initialization to put the device in
133 * graphics mode
134 */
135extern int ufb_enter_graphics( int fd, int mode );
136
137
138/*
139 * Switch the device back to the default mode of operation.
140 * In most cases it put the device back to plain text mode.
141 */
142extern int ufb_exit_graphics( int fd );
143
144
145/*
146 * Tell the driver that the "virtual buffer" is dirty, and an update
147 * of it to the real device, maybe a serial/parallel LCD or whatever
148 * is required
149 */
150extern int ufb_buffer_is_dirty( int fd );
151
152
153/*
154 * This function maps the physical ( kernel mode ) address of the framebuffer device
155 * and maps it to the user space address.
156 */
157 int ufb_mmap_to_user_space( int fd, void **fb_addr, void *physical_addr, unsigned long size );
158
159
160
161/*
162 * This function unmaps memory of the FB from the user's space
163 */
164 int ufb_unmmap_from_user_space( int fd, void *addr );
165
166#ifdef  __cplusplus
167}
168#endif
169
170#endif /* _MW_FB_H */
Note: See TracBrowser for help on using the repository browser.