annotate packages/io/framebuf/current/src/framebuf.c @ 2729:74dbf4c3f2e1 after-copyright-change-20090129

Update all copyright banners to reflect FSF ownership; fix and improve licence text.
author jlarmour
date Thu, 29 Jan 2009 17:47:46 +0000
parents f9d071633ee7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2565
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
1 //==========================================================================
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
2 //
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
3 // framebuf.c
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
4 //
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
5 // Generic API for accessing framebuffers
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
6 //
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
7 //==========================================================================
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
8 // ####ECOSGPLCOPYRIGHTBEGIN####
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
9 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
10 // This file is part of eCos, the Embedded Configurable Operating System.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
11 // Copyright (C) 2008 Free Software Foundation, Inc.
2565
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
12 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
13 // eCos is free software; you can redistribute it and/or modify it under
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
14 // the terms of the GNU General Public License as published by the Free
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
15 // Software Foundation; either version 2 or (at your option) any later
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
16 // version.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
17 //
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
18 // eCos is distributed in the hope that it will be useful, but WITHOUT
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
19 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
20 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
21 // for more details.
2565
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
22 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
23 // You should have received a copy of the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
24 // along with eCos; if not, write to the Free Software Foundation, Inc.,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
25 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2565
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
26 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
27 // As a special exception, if other files instantiate templates or use
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
28 // macros or inline functions from this file, or you compile this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
29 // and link it with other works to produce a work based on this file,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
30 // this file does not by itself cause the resulting work to be covered by
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
31 // the GNU General Public License. However the source code for this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
32 // must still be made available in accordance with section (3) of the GNU
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
33 // General Public License v2.
2565
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
34 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
35 // This exception does not invalidate any other reasons why a work based
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
36 // on this file might be covered by the GNU General Public License.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
37 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2565
diff changeset
38 // ####ECOSGPLCOPYRIGHTEND####
2565
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
39 //==========================================================================
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
40 //###DESCRIPTIONBEGIN####
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
41 //
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
42 // Author(s): bartv
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
43 // Date: 2005-03-29
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
44 //
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
45 //###DESCRIPTIONEND####
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
46 //========================================================================
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
47
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
48 #define __CYG_FB_IN_FRAMEBUF_C 1
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
49 #include <cyg/io/framebuf.h>
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
50
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
51 #include <cyg/infra/cyg_type.h>
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
52 #include <cyg/infra/cyg_ass.h>
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
53 #include <errno.h>
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
54
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
55 // Implementations of the framebuffer functions. Production code
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
56 // normally uses extern inline versions of these, defined in
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
57 // framebuf.h. However real functions are supplied here in case
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
58 // higher-level code chooses to take the address of a function for
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
59 // some reason. Also when building for debugging (CYGPKG_INFRA_DEBUG)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
60 // the inline functions are suppressed and the real functions here
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
61 // contain lots of useful assertions.
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
62
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
63 int
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
64 cyg_fb_on(cyg_fb* fb)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
65 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
66 int result;
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
67
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
68 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
69 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
70 CYG_CHECK_FUNC_PTRC(fb->fb_on_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
71 CYG_CHECK_FUNC_PTRC(fb->fb_off_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
72 CYG_CHECK_FUNC_PTRC(fb->fb_write_pixel_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
73 CYG_CHECK_FUNC_PTRC(fb->fb_read_pixel_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
74 CYG_CHECK_FUNC_PTRC(fb->fb_write_hline_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
75 CYG_CHECK_FUNC_PTRC(fb->fb_write_vline_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
76 CYG_CHECK_FUNC_PTRC(fb->fb_fill_block_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
77 CYG_CHECK_FUNC_PTRC(fb->fb_write_block_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
78 CYG_CHECK_FUNC_PTRC(fb->fb_read_block_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
79 CYG_CHECK_FUNC_PTRC(fb->fb_move_block_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
80
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
81 result = (*(fb->fb_on_fn))(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
82 return result;
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
83 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
84
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
85 int
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
86 cyg_fb_off(cyg_fb* fb)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
87 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
88 int result;
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
89
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
90 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
91 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
92 CYG_CHECK_FUNC_PTRC(fb->fb_off_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
93
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
94 result = (*(fb->fb_off_fn))(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
95 return result;
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
96 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
97
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
98 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
99 cyg_fb_write_pixel(cyg_fb* fb, cyg_ucount16 x, cyg_ucount16 y, cyg_fb_colour colour)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
100 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
101 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
102 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
103 CYG_CHECK_FUNC_PTRC(fb->fb_write_pixel_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
104
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
105 CYG_PRECONDITIONC(x < fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
106 CYG_PRECONDITIONC(y < fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
107 CYG_PRECONDITIONC((colour <= 1) || (fb->fb_depth > 1));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
108 CYG_PRECONDITIONC((colour <= 3) || (fb->fb_depth > 2));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
109 CYG_PRECONDITIONC((colour <= 15) || (fb->fb_depth > 4));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
110 CYG_PRECONDITIONC((colour <= 255) || (fb->fb_depth > 8));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
111 CYG_PRECONDITIONC((colour <= 65535) || (fb->fb_depth > 16));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
112
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
113 (*(fb->fb_write_pixel_fn))(fb, x, y, colour);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
114 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
115
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
116 cyg_fb_colour
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
117 cyg_fb_read_pixel(cyg_fb* fb, cyg_ucount16 x, cyg_ucount16 y)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
118 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
119 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
120 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
121 CYG_CHECK_FUNC_PTRC(fb->fb_read_pixel_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
122
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
123 CYG_PRECONDITIONC(x < fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
124 CYG_PRECONDITIONC(y < fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
125
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
126 return (*(fb->fb_read_pixel_fn))(fb, x, y);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
127 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
128
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
129 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
130 cyg_fb_write_hline(cyg_fb* fb, cyg_ucount16 x, cyg_ucount16 y, cyg_ucount16 len, cyg_fb_colour colour)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
131 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
132 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
133 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
134 CYG_CHECK_FUNC_PTRC(fb->fb_write_hline_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
135
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
136 CYG_PRECONDITIONC(x < fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
137 CYG_PRECONDITIONC(y < fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
138 CYG_PRECONDITIONC((x + len) <= fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
139 CYG_PRECONDITIONC((colour <= 1) || (fb->fb_depth > 1));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
140 CYG_PRECONDITIONC((colour <= 3) || (fb->fb_depth > 2));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
141 CYG_PRECONDITIONC((colour <= 15) || (fb->fb_depth > 4));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
142 CYG_PRECONDITIONC((colour <= 255) || (fb->fb_depth > 8));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
143 CYG_PRECONDITIONC((colour <= 65535) || (fb->fb_depth > 16));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
144
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
145 (*(fb->fb_write_hline_fn))(fb, x, y, len, colour);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
146 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
147
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
148 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
149 cyg_fb_write_vline(cyg_fb* fb, cyg_ucount16 x, cyg_ucount16 y, cyg_ucount16 len, cyg_fb_colour colour)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
150 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
151 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
152 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
153 CYG_CHECK_FUNC_PTRC(fb->fb_write_vline_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
154
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
155 CYG_PRECONDITIONC(x < fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
156 CYG_PRECONDITIONC(y < fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
157 CYG_PRECONDITIONC((y + len) <= fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
158 CYG_PRECONDITIONC((colour <= 1) || (fb->fb_depth > 1));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
159 CYG_PRECONDITIONC((colour <= 3) || (fb->fb_depth > 2));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
160 CYG_PRECONDITIONC((colour <= 15) || (fb->fb_depth > 4));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
161 CYG_PRECONDITIONC((colour <= 255) || (fb->fb_depth > 8));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
162 CYG_PRECONDITIONC((colour <= 65535) || (fb->fb_depth > 16));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
163
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
164 (*(fb->fb_write_vline_fn))(fb, x, y, len, colour);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
165 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
166
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
167 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
168 cyg_fb_fill_block(cyg_fb* fb, cyg_ucount16 x, cyg_ucount16 y, cyg_ucount16 width, cyg_ucount16 height, cyg_fb_colour colour)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
169 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
170 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
171 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
172 CYG_CHECK_FUNC_PTRC(fb->fb_fill_block_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
173
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
174 CYG_PRECONDITIONC(x < fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
175 CYG_PRECONDITIONC(y < fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
176 CYG_PRECONDITIONC((x + width) <= fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
177 CYG_PRECONDITIONC((y + height) <= fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
178 CYG_PRECONDITIONC((colour <= 1) || (fb->fb_depth > 1));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
179 CYG_PRECONDITIONC((colour <= 3) || (fb->fb_depth > 2));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
180 CYG_PRECONDITIONC((colour <= 15) || (fb->fb_depth > 4));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
181 CYG_PRECONDITIONC((colour <= 255) || (fb->fb_depth > 8));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
182 CYG_PRECONDITIONC((colour <= 65535) || (fb->fb_depth > 16));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
183
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
184 (*(fb->fb_fill_block_fn))(fb, x, y, width, height, colour);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
185 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
186
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
187 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
188 cyg_fb_write_block(cyg_fb* fb, cyg_ucount16 x, cyg_ucount16 y, cyg_ucount16 width, cyg_ucount16 height,
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
189 const void* source, cyg_ucount16 offset, cyg_ucount16 stride)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
190 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
191 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
192 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
193 CYG_CHECK_FUNC_PTRC(fb->fb_write_block_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
194
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
195 CYG_CHECK_DATA_PTRC(source);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
196 CYG_PRECONDITIONC(x < fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
197 CYG_PRECONDITIONC(y < fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
198 CYG_PRECONDITIONC((x + width) <= fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
199 CYG_PRECONDITIONC((y + height) <= fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
200
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
201 (*(fb->fb_write_block_fn))(fb, x, y, width, height, source, offset, stride);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
202 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
203
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
204 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
205 cyg_fb_read_block(cyg_fb* fb, cyg_ucount16 x, cyg_ucount16 y, cyg_ucount16 width, cyg_ucount16 height,
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
206 void* dest, cyg_ucount16 offset, cyg_ucount16 stride)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
207 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
208 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
209 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
210 CYG_CHECK_FUNC_PTRC(fb->fb_read_block_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
211
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
212 CYG_CHECK_DATA_PTRC(dest);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
213 CYG_PRECONDITIONC(x < fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
214 CYG_PRECONDITIONC(y < fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
215 CYG_PRECONDITIONC((x + width) <= fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
216 CYG_PRECONDITIONC((y + height) <= fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
217
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
218 (*(fb->fb_read_block_fn))(fb, x, y, width, height, dest, offset, stride);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
219 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
220
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
221 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
222 cyg_fb_move_block(cyg_fb* fb, cyg_ucount16 x, cyg_ucount16 y, cyg_ucount16 width, cyg_ucount16 height, cyg_ucount16 new_x, cyg_ucount16 new_y)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
223 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
224 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
225 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
226 CYG_CHECK_FUNC_PTRC(fb->fb_move_block_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
227
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
228 CYG_PRECONDITIONC(x != new_x);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
229 CYG_PRECONDITIONC(y != new_y);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
230 CYG_PRECONDITIONC(x < fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
231 CYG_PRECONDITIONC(y < fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
232 CYG_PRECONDITIONC((x + width) <= fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
233 CYG_PRECONDITIONC((y + height) <= fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
234 CYG_PRECONDITIONC(new_x < fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
235 CYG_PRECONDITIONC(new_y < fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
236 CYG_PRECONDITIONC((new_x + width) <= fb->fb_width);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
237 CYG_PRECONDITIONC((new_y + height) <= fb->fb_height);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
238
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
239 (*(fb->fb_move_block_fn))(fb, x, y, width, height, new_x, new_y);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
240 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
241
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
242 int
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
243 cyg_fb_ioctl(cyg_fb* fb, cyg_uint16 key, void* data, size_t* len)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
244 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
245 int result;
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
246
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
247 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
248 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
249 CYG_CHECK_FUNC_PTRC(fb->fb_ioctl_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
250
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
251 result = (*(fb->fb_ioctl_fn))(fb, key, data, len);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
252 return result;
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
253 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
254
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
255 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
256 cyg_fb_synch(cyg_fb* fb, cyg_ucount16 when)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
257 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
258 #ifdef CYGHWR_IO_FRAMEBUF_FUNCTIONALITY_DOUBLE_BUFFER
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
259 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
260 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
261 CYG_CHECK_FUNC_PTRC(fb->fb_move_block_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
262 (*(fb->fb_synch_fn))(fb, when);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
263 #else
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
264 // Synch is a no-op
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
265 #endif
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
266 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
267
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
268 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
269 cyg_fb_read_palette(cyg_fb* fb, cyg_ucount32 first, cyg_ucount32 count, void* dest)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
270 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
271 #ifdef CYGHWR_IO_FRAMEBUF_FUNCTIONALITY_PALETTE
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
272 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
273 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
274 CYG_CHECK_FUNC_PTRC(fb->fb_read_palette_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
275 CYG_CHECK_DATA_PTRC(dest);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
276
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
277 CYG_PRECONDITIONC( (first < 16) || (fb->fb_depth > 4));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
278 CYG_PRECONDITIONC(((first + count) < 16) || (fb->fb_depth > 4));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
279 CYG_PRECONDITIONC( (first < 256) || (fb->fb_depth > 8));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
280 CYG_PRECONDITIONC(((first + count) <= 256) || (fb->fb_depth > 8));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
281
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
282 (*(fb->fb_read_palette_fn))(fb, first, count, dest);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
283 #else
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
284 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
285 CYG_UNUSED_PARAM(cyg_ucount32, first);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
286 CYG_UNUSED_PARAM(cyg_ucount32, count);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
287 CYG_UNUSED_PARAM(void*, dest);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
288 #endif
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
289 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
290
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
291 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
292 cyg_fb_write_palette(cyg_fb* fb, cyg_ucount32 first, cyg_ucount32 count, const void* source, cyg_ucount16 when)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
293 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
294 #ifdef CYGHWR_IO_FRAMEBUF_FUNCTIONALITY_WRITEABLE_PALETTE
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
295 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
296 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
297 CYG_CHECK_FUNC_PTRC(fb->fb_write_palette_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
298 CYG_CHECK_DATA_PTRC(source);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
299
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
300 CYG_PRECONDITIONC( (first < 16) || (fb->fb_depth > 4));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
301 CYG_PRECONDITIONC(((first + count) < 16) || (fb->fb_depth > 4));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
302 CYG_PRECONDITIONC( (first < 256) || (fb->fb_depth > 8));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
303 CYG_PRECONDITIONC(((first + count) <= 256) || (fb->fb_depth > 8));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
304
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
305 (*(fb->fb_write_palette_fn))(fb, first, count, source, when);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
306 #else
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
307 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
308 CYG_UNUSED_PARAM(cyg_ucount32, first);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
309 CYG_UNUSED_PARAM(cyg_ucount32, count);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
310 CYG_UNUSED_PARAM(const void*, source);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
311 CYG_UNUSED_PARAM(cyg_ucount16, when);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
312 #endif
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
313 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
314
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
315 cyg_fb_colour
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
316 cyg_fb_make_colour(cyg_fb* fb, cyg_ucount8 r, cyg_ucount8 g, cyg_ucount8 b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
317 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
318 #ifdef CYGHWR_IO_FRAMEBUF_FUNCTIONALITY_TRUE_COLOUR
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
319 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
320 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
321 CYG_CHECK_FUNC_PTRC(fb->fb_make_colour_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
322 CYG_PRECONDITIONC((r <= 0x00FF) && (g <= 0x00FF) && (b <= 0x00FF));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
323
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
324 return (*(fb->fb_make_colour_fn))(fb, r, g, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
325 #else
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
326 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
327 CYG_UNUSED_PARAM(cyg_ucount8, r);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
328 CYG_UNUSED_PARAM(cyg_ucount8, g);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
329 CYG_UNUSED_PARAM(cyg_ucount8, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
330 return 0;
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
331 #endif
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
332 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
333
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
334 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
335 cyg_fb_break_colour(cyg_fb* fb, cyg_fb_colour colour, cyg_ucount8* r, cyg_ucount8* g, cyg_ucount8* b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
336 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
337 #ifdef CYGHWR_IO_FRAMEBUF_FUNCTIONALITY_TRUE_COLOUR
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
338 CYG_CHECK_DATA_PTRC(fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
339 CYG_PRECONDITIONC(CYG_FB_MAGIC == fb->fb_magic);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
340 CYG_CHECK_FUNC_PTRC(fb->fb_break_colour_fn);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
341 CYG_CHECK_DATA_PTRC(r);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
342 CYG_CHECK_DATA_PTRC(g);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
343 CYG_CHECK_DATA_PTRC(b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
344
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
345 (*(fb->fb_break_colour_fn))(fb, colour, r, g, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
346 #else
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
347 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
348 CYG_UNUSED_PARAM(cyg_fb_colour, colour);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
349 CYG_UNUSED_PARAM(cyg_ucount8*, r);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
350 CYG_UNUSED_PARAM(cyg_ucount8*, g);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
351 CYG_UNUSED_PARAM(cyg_ucount8*, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
352 #endif
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
353 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
354
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
355 // ----------------------------------------------------------------------------
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
356 // Dummy functions for use by device drivers when instantiating a cyg_fb
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
357 // structure
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
358
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
359 int
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
360 cyg_fb_nop_on(cyg_fb* fb)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
361 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
362 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
363 return 0;
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
364 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
365
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
366 int
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
367 cyg_fb_nop_off(cyg_fb* fb)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
368 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
369 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
370 return 0;
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
371 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
372
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
373 int
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
374 cyg_fb_nop_ioctl(cyg_fb* fb, cyg_uint16 key, void* data, size_t* len)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
375 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
376 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
377 CYG_UNUSED_PARAM(cyg_uint16, key);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
378 CYG_UNUSED_PARAM(void*, data);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
379 CYG_UNUSED_PARAM(size_t*, len);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
380 return ENOSYS;
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
381 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
382
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
383 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
384 cyg_fb_nop_synch(cyg_fb* fb, cyg_ucount16 when)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
385 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
386 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
387 CYG_UNUSED_PARAM(cyg_ucount16, when);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
388 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
389
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
390 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
391 cyg_fb_nop_write_palette(cyg_fb* fb, cyg_ucount32 first, cyg_ucount32 count, const void* source, cyg_ucount16 when)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
392 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
393 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
394 CYG_UNUSED_PARAM(cyg_ucount32, first);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
395 CYG_UNUSED_PARAM(cyg_ucount32, count);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
396 CYG_UNUSED_PARAM(const void*, source);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
397 CYG_UNUSED_PARAM(cyg_ucount16, when);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
398 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
399
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
400 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
401 cyg_fb_nop_read_palette(cyg_fb* fb, cyg_ucount32 first, cyg_ucount32 count, void* dest)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
402 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
403 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
404 CYG_UNUSED_PARAM(cyg_ucount32, first);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
405 CYG_UNUSED_PARAM(cyg_ucount32, count);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
406 CYG_UNUSED_PARAM(void*, dest);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
407 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
408
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
409 cyg_fb_colour
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
410 cyg_fb_nop_make_colour(cyg_fb* fb, cyg_ucount8 r, cyg_ucount8 g, cyg_ucount8 b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
411 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
412 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
413 CYG_UNUSED_PARAM(cyg_ucount8, r);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
414 CYG_UNUSED_PARAM(cyg_ucount8, g);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
415 CYG_UNUSED_PARAM(cyg_ucount8, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
416 return 0;
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
417 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
418
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
419 cyg_fb_colour
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
420 cyg_fb_nop_make_color(cyg_fb* fb, cyg_ucount8 r, cyg_ucount8 g, cyg_ucount8 b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
421 __attribute__((alias("cyg_fb_nop_make_colour")));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
422
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
423 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
424 cyg_fb_nop_break_colour(cyg_fb* fb, cyg_fb_colour colour, cyg_ucount8* r, cyg_ucount8* g, cyg_ucount8* b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
425 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
426 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
427 CYG_UNUSED_PARAM(cyg_fb_colour, colour);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
428 CYG_UNUSED_PARAM(cyg_ucount8*, r);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
429 CYG_UNUSED_PARAM(cyg_ucount8*, g);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
430 CYG_UNUSED_PARAM(cyg_ucount8*, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
431 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
432
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
433 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
434 cyg_fb_nop_break_color(cyg_fb* fb, cyg_fb_colour colour, cyg_ucount8* r, cyg_ucount8* g, cyg_ucount8* b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
435 __attribute__((alias("cyg_fb_nop_break_colour")));
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
436
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
437 // ----------------------------------------------------------------------------
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
438 // Utility functions for common true colour modes
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
439
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
440 cyg_fb_colour
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
441 cyg_fb_dev_make_colour_8bpp_true_332(cyg_fb* fb, cyg_ucount8 r, cyg_ucount8 g, cyg_ucount8 b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
442 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
443 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
444 return CYG_FB_MAKE_COLOUR_8BPP_TRUE_332(r, g, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
445 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
446
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
447 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
448 cyg_fb_dev_break_colour_8bpp_true_332(cyg_fb* fb, cyg_fb_colour colour, cyg_ucount8* r, cyg_ucount8* g, cyg_ucount8* b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
449 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
450 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
451 CYG_FB_BREAK_COLOUR_8BPP_TRUE_332(colour, r, g, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
452 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
453
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
454 cyg_fb_colour
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
455 cyg_fb_dev_make_colour_16bpp_true_565(cyg_fb* fb, cyg_ucount8 r, cyg_ucount8 g, cyg_ucount8 b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
456 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
457 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
458 return CYG_FB_MAKE_COLOUR_16BPP_TRUE_565(r, g, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
459 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
460
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
461 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
462 cyg_fb_dev_break_colour_16bpp_true_565(cyg_fb* fb, cyg_fb_colour colour, cyg_ucount8* r, cyg_ucount8* g, cyg_ucount8* b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
463 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
464 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
465 CYG_FB_BREAK_COLOUR_16BPP_TRUE_565(colour, r, g, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
466 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
467
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
468 cyg_fb_colour
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
469 cyg_fb_dev_make_colour_16bpp_true_555(cyg_fb* fb, cyg_ucount8 r, cyg_ucount8 g, cyg_ucount8 b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
470 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
471 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
472 return CYG_FB_MAKE_COLOUR_16BPP_TRUE_555(r, g, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
473 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
474
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
475 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
476 cyg_fb_dev_break_colour_16bpp_true_555(cyg_fb* fb, cyg_fb_colour colour, cyg_ucount8* r, cyg_ucount8* g, cyg_ucount8* b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
477 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
478 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
479 CYG_FB_BREAK_COLOUR_16BPP_TRUE_555(colour, r, g, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
480 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
481
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
482 cyg_fb_colour
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
483 cyg_fb_dev_make_colour_32bpp_true_0888(cyg_fb* fb, cyg_ucount8 r, cyg_ucount8 g, cyg_ucount8 b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
484 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
485 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
486 return CYG_FB_MAKE_COLOUR_32BPP_TRUE_0888(r, g, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
487 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
488
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
489 void
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
490 cyg_fb_dev_break_colour_32bpp_true_0888(cyg_fb* fb, cyg_fb_colour colour, cyg_ucount8* r, cyg_ucount8* g, cyg_ucount8* b)
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
491 {
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
492 CYG_UNUSED_PARAM(cyg_fb*, fb);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
493 CYG_FB_BREAK_COLOUR_32BPP_TRUE_0888(colour, r, g, b);
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
494 }
f9d071633ee7 Contribute eCosCentric's framebuffer infrastructure.
bartv
parents:
diff changeset
495