FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/drivers/drv_app/r2d/r2d_config.h @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /*************************************************************************** | |
2 | |
3 Name r2d_config.h | |
4 | |
5 Function Hardware dependent configurations | |
6 | |
7 Date Modification | |
8 ----------------------- | |
9 06/12/2001 Create | |
10 ************************************************************************** | |
11 History | |
12 | |
13 ****************************************************************************/ | |
14 | |
15 | |
16 #ifndef __R2D_CONFIG__ | |
17 #define __R2D_CONFIG__ | |
18 | |
19 #ifndef _WINDOWS | |
20 #include "config/r2d.cfg" | |
21 #include "config/board.cfg" | |
22 #include "config/swconfig.cfg" | |
23 #endif | |
24 | |
25 /******************************* | |
26 | |
27 MISC R2D CONSTANTS | |
28 | |
29 *******************************/ | |
30 | |
31 | |
32 #define R2D_ON 1 | |
33 #define R2D_OFF 0 | |
34 | |
35 #define R2D_DEBUG_LOW 0 | |
36 #define R2D_DEBUG_HIGH 1 | |
37 | |
38 // Color mode for the LCD | |
39 #define R2D_MONOCHROME 0 | |
40 #define R2D_COLOR 1 | |
41 | |
42 // Mode of refresh for the LCD | |
43 #define R2D_VERTICAL 0 | |
44 #define R2D_HORIZONTAL 1 | |
45 | |
46 // List of kind of supported LCDs | |
47 #define R2D_SIMPLE_LCD 1 | |
48 #define R2D_PC_COLOR_LCD 2 | |
49 #define R2D_MIRRORED_LCD 3 | |
50 #define R2D_CUSTOMER_LCD 4 | |
51 #define R2D_HORIZONTAL_LCD 5 | |
52 #define R2D_BOARD_COLOR_LCD 6 | |
53 #define R2D_BOARD_DSAMPLE 7 | |
54 #define R2D_BOARD_BW_DSAMPLE 8 | |
55 #define R2D_BOARD_ESAMPLE 9 | |
56 #define R2D_PC_CSAMPLE 108 | |
57 #define R2D_PC_DSAMPLE 109 | |
58 | |
59 /******************************* | |
60 | |
61 Riviera 2D configuration | |
62 | |
63 *******************************/ | |
64 | |
65 | |
66 // ln2 of dimension of dithering matrix | |
67 // (must change code if that value is changed) | |
68 #define R2D_DITHERING_DIMENSION 2 | |
69 | |
70 #define R2D_DEBUG R2D_ON | |
71 | |
72 #define R2D_DEBUG_WARNING R2D_DEBUG_LOW | |
73 | |
74 // For still on development new features | |
75 #define R2D_EXPERIMENT R2D_ON | |
76 | |
77 // C-Sample for PC | |
78 #ifdef _WINDOWS | |
79 #define R2D_REFRESH_PERIOD 50 // ms | |
80 #define R2D_EMBEDDED_LCD R2D_PC_COLOR_LCD | |
81 #endif | |
82 | |
83 #if (R2D_LCD_TEST == 1) | |
84 #define R2D_REFRESH_PERIOD 40 // ms | |
85 #define R2D_EMBEDDED_LCD R2D_BOARD_COLOR_LCD | |
86 #else | |
87 #if ((BOARD == 7) || (BOARD == 8) || (BOARD == 9)) | |
88 // C-Sample is equipped with Mirrored LCD | |
89 #define R2D_REFRESH_PERIOD 40 // ms | |
90 #define R2D_EMBEDDED_LCD R2D_MIRRORED_LCD | |
91 #elif ((BOARD == 40) || (BOARD == 41) || (BOARD == 42) || (BOARD == 43)) | |
92 #if (!GSMLITE) | |
93 // D-Sample Board with Color Display | |
94 #define R2D_REFRESH_PERIOD 40 // ms | |
95 #define R2D_EMBEDDED_LCD R2D_BOARD_DSAMPLE | |
96 #else | |
97 // D-Sample Board with simulated B&W Display | |
98 #define R2D_REFRESH_PERIOD 40 // ms | |
99 #define R2D_EMBEDDED_LCD R2D_BOARD_BW_DSAMPLE | |
100 #endif | |
101 #endif | |
102 #endif | |
103 | |
104 // Launch R2D_REFRESH_LOOP to estimate the time | |
105 // taken by one loop | |
106 #define R2D_BENCHMARKING R2D_OFF | |
107 #define R2D_REFRESH_LOOP 100 | |
108 | |
109 | |
110 /******************************* | |
111 | |
112 Hardware dependence | |
113 | |
114 *******************************/ | |
115 | |
116 // Shift by 2 to get the size of a long int | |
117 #define R2D_LONGSIZE_FACTOR 2 | |
118 | |
119 // ln2 of the size of a memory word in bits | |
120 // (2^5 = 32 bits) | |
121 #define R2D_MEMORY_WORD 5 | |
122 | |
123 /******************************* | |
124 | |
125 Values used internally | |
126 | |
127 *******************************/ | |
128 | |
129 #if (R2D_EMBEDDED_LCD == R2D_SIMPLE_LCD) | |
130 #include "r2d/lcds/simple/r2d_simple_lcd_i.h" | |
131 #endif | |
132 | |
133 // Color LCD is just a simulation on PC and is using the | |
134 // color framebuffers | |
135 #if (R2D_EMBEDDED_LCD == R2D_PC_COLOR_LCD) | |
136 #include "r2d/lcds/colorpc/r2d_pc_color_lcd_i.h" | |
137 #endif | |
138 | |
139 #if (R2D_EMBEDDED_LCD == R2D_PC_CSAMPLE) | |
140 #include "r2d/lcds/pc_csample/r2d_pc_csample_lcd_i.h" | |
141 #endif | |
142 | |
143 #if (R2D_EMBEDDED_LCD == R2D_PC_DSAMPLE) | |
144 #include "r2d/lcds/pc_dsample/r2d_pc_dsample_lcd_i.h" | |
145 #endif | |
146 | |
147 // Color LCD is just a simulation on PC and is using the | |
148 // color framebuffers | |
149 #if (R2D_EMBEDDED_LCD == R2D_MIRRORED_LCD) | |
150 #include "r2d/lcds/mirrored/r2d_mirrored_lcd_i.h" | |
151 #endif | |
152 | |
153 #if (R2D_EMBEDDED_LCD == R2D_CUSTOMER_LCD) | |
154 #include "r2d/lcds/customer/r2d_customer_lcd_i.h" | |
155 #endif | |
156 | |
157 #if (R2D_EMBEDDED_LCD == R2D_HORIZONTAL_LCD) | |
158 #include "r2d/lcds/horizontal/r2d_horizontal_lcd_i.h" | |
159 #endif | |
160 | |
161 #if (R2D_EMBEDDED_LCD == R2D_BOARD_COLOR_LCD) | |
162 #include "r2d/lcds/colorboard/r2d_board_color_lcd_i.h" | |
163 #endif | |
164 | |
165 #if (R2D_EMBEDDED_LCD == R2D_BOARD_DSAMPLE) | |
166 #include "r2d/lcds/d_sample/r2d_board_dsample_i.h" | |
167 #endif | |
168 | |
169 #if (R2D_EMBEDDED_LCD == R2D_BOARD_BW_DSAMPLE) | |
170 #include "r2d/lcds/bw_d_sample/r2d_board_bw_dsample_i.h" | |
171 #endif | |
172 | |
173 #if (R2D_EMBEDDED_LCD == R2D_PC_COLOR_LCD) | |
174 #ifdef R2D_ASM | |
175 #undef R2D_ASM | |
176 #endif | |
177 #define R2D_ASM R2D_OFF | |
178 #endif | |
179 | |
180 #if (R2D_ASM == R2D_ON) | |
181 #if (R2D_DITHERING == R2D_ON) | |
182 #undef R2D_DITHERING | |
183 #define R2D_DITHERING R2D_OFF | |
184 #endif | |
185 | |
186 #endif | |
187 | |
188 | |
189 // Mask used to write or read a pixel value from a memory word | |
190 // It is also used in monochrome mode to extract the intensity level | |
191 // In color mode, a pixel will contain several intensity | |
192 // level and another mask to extract components should be used | |
193 | |
194 // ifdef used because of limitation with TI preprocessor | |
195 // which is giving 0 for R2D_PIXEL_MASK instead of 0xFFFFFFFF | |
196 // when R2D_PIXEL_DEPTH is 32 | |
197 #if (R2D_PIXEL_DEPTH == 32) | |
198 #define R2D_PIXEL_MASK 0xFFFFFFFF | |
199 #else | |
200 #define R2D_PIXEL_MASK (~(-1<<R2D_PIXEL_DEPTH)) | |
201 #endif | |
202 | |
203 // Pixel value mask for dithered levels | |
204 #define R2D_DITHERED_MASK (~(-1<<R2D_DITHERING_DIMENSION)) | |
205 | |
206 | |
207 #if (R2D_PIXELS_PER_MEMORY_WORD == 0) | |
208 | |
209 // Position of the pixel in a memory word is extracted with | |
210 // that mask applied to the pixel horizontal or vertical | |
211 // coordinate (depending on the REFRESH mode) | |
212 // It allows to convert between unit pixels to unit memory words | |
213 #define R2D_WORD_POSITION_MASK 0 | |
214 | |
215 // Extension of vertical or horizontal for memory alignments | |
216 // constraints | |
217 #if (R2D_REFRESH == R2D_VERTICAL) | |
218 #define R2D_MWHEIGHT R2D_HEIGHT | |
219 #else | |
220 #define R2D_MWWIDTH R2D_WIDTH | |
221 #endif | |
222 | |
223 // Extend lengths to a integer number of memory words | |
224 // and return new length in memory word units | |
225 #define R2D_ALIGNED_MWLENGTH(a) a | |
226 #else | |
227 // Above formula are right when the number of pixels | |
228 // can be divided by 2 (so R2D_PIXELS_PER_MEMORY_WORD != 0 ) | |
229 | |
230 // Position of the pixel in a memory word is extracted with | |
231 // that mask applied to the pixel horizontal or vertical | |
232 // coordinate (depending on the REFRESH mode) | |
233 // It allows to convert between unit pixels to unit memory words | |
234 #define R2D_WORD_POSITION_MASK (~(-1<<R2D_PIXELS_PER_MEMORY_WORD)) | |
235 | |
236 // Extension of vertical or horizontal for memory alignments | |
237 // constraints (the extension is done by excess. Sometime one | |
238 // word may be added although it is not really needed) | |
239 #if (R2D_REFRESH == R2D_VERTICAL) | |
240 #define R2D_MWHEIGHT ((R2D_HEIGHT>>R2D_PIXELS_PER_MEMORY_WORD)+1) | |
241 #else | |
242 #define R2D_MWWIDTH ((R2D_WIDTH>>R2D_PIXELS_PER_MEMORY_WORD)+1) | |
243 #endif | |
244 | |
245 // Extend lengths to a integer number of memory words | |
246 // and return new length in memory word units | |
247 | |
248 // Never change it. It used for blit_rect | |
249 #define R2D_ALIGNED_MWLENGTH(a) ((a>>R2D_PIXELS_PER_MEMORY_WORD) + 1) | |
250 | |
251 | |
252 #endif | |
253 // Start of description of metrics values | |
254 // for each char | |
255 // The first values are the global ones for the font | |
256 #define R2D_METRIC_START 8 | |
257 | |
258 | |
259 // Position of buffer width value relative | |
260 // to start of char metrics in a font metric array | |
261 #define R2D_BUFFER_WIDTH_POS (-5) | |
262 | |
263 | |
264 | |
265 #endif |