]> git.sur5r.net Git - freertos/blob - Demo/SuperH_SH7216_Renesas/RTOSDemo/RenesasCode/types.h
Update SuperH port to include WEB server.
[freertos] / Demo / SuperH_SH7216_Renesas / RTOSDemo / RenesasCode / types.h
1 /******************************************************************************\r
2 * File Name    : types.h\r
3 * Version      : 1.0\r
4 * Device(s)    : Renesas\r
5 * Tool-Chain   : Renesas SH2A V9+\r
6 * OS           : None\r
7 * H/W Platform : SH2A\r
8 * Description  : User Defined Type Definition File\r
9 *******************************************************************************\r
10 * History      : DD.MM.YYYY Ver. Description\r
11 *              : 01.08.2009 1.00 MAB First Release\r
12 ******************************************************************************/\r
13 \r
14 /******************************************************************************\r
15 * DISCLAIMER\r
16 * This software is supplied by Renesas Technology Corp. and is only\r
17 * intended for use with Renesas products. No other uses are authorized.\r
18 * This software is owned by Renesas Technology Corp. and is protected under\r
19 * all applicable laws, including copyright laws.\r
20 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES\r
21 * REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY,\r
22 * INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\r
23 * PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY\r
24 * DISCLAIMED.\r
25 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS\r
26 * TECHNOLOGY CORP. NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE\r
27 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES\r
28 * FOR ANY REASON RELATED TO THE THIS SOFTWARE, EVEN IF RENESAS OR ITS\r
29 * AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\r
30 * Renesas reserves the right, without notice, to make changes to this\r
31 * software and to discontinue the availability of this software.\r
32 * By using this software, you agree to the additional terms and\r
33 * conditions found by accessing the following link:\r
34 * http://www.renesas.com/disclaimer\r
35 ******************************************************************************/\r
36 /* Copyright (C) 2008. Renesas Technology Corp.,       All Rights Reserved.  */\r
37 /* Copyright (C) 2009. Renesas Technology Europe Ltd., All Rights Reserved.  */\r
38 /*****************************************************************************/\r
39 \r
40 #ifndef TYPES_H_INCLUDED\r
41 #define TYPES_H_INCLUDED\r
42 \r
43 /******************************************************************************\r
44 User Includes\r
45 ******************************************************************************/\r
46 \r
47 #include "Compiler.h"\r
48 \r
49 /******************************************************************************\r
50 Function Macros\r
51 ******************************************************************************/\r
52 \r
53 #ifndef SWAPWORD\r
54 #define SWAPWORD(x)           (WORD)((((x) & 0xFF) << 8) | (((x) >> 8) & 0xFF))\r
55 #endif\r
56 \r
57 #ifndef LOBYTE\r
58 #define LOBYTE(x)             (BYTE)(x)\r
59 #endif\r
60 \r
61 #ifndef HIBYTE\r
62 #define HIBYTE(x)             (BYTE)((x) >> 8)\r
63 #endif\r
64 \r
65 #ifndef MAKEWORD\r
66 #define MAKEWORD(a, b)        ((WORD) (((BYTE) (a)) |\\r
67                               ((WORD) ((BYTE) (b))) << 8))\r
68 #endif\r
69 \r
70 /******************************************************************************\r
71 Typedefs\r
72 ******************************************************************************/\r
73 \r
74 /* Generic definitions */\r
75 #ifndef NULL                        /* set null ((void *)0) */\r
76 #define NULL                        0\r
77 #endif\r
78 \r
79 #ifndef PNULL\r
80 #define PNULL                       ((PVOID)0)\r
81 #endif\r
82 \r
83 #ifndef BIT_0                       /* set bits */\r
84 #define BIT_0                       0x1\r
85 #define BIT_1                       0x2\r
86 #define BIT_2                       0x4\r
87 #define BIT_3                       0x8\r
88 #define BIT_4                       0x10\r
89 #define BIT_5                       0x20\r
90 #define BIT_6                       0x40\r
91 #define BIT_7                       0x80\r
92 \r
93 #define BIT_8                       0x100\r
94 #define BIT_9                       0x200\r
95 #define BIT_10                      0x400\r
96 #define BIT_11                      0x800\r
97 #define BIT_12                      0x1000\r
98 #define BIT_13                      0x2000\r
99 #define BIT_14                      0x4000\r
100 #define BIT_15                      0x8000\r
101 \r
102 #define BIT_16                      0x10000L\r
103 #define BIT_17                      0x20000L\r
104 #define BIT_18                      0x40000L\r
105 #define BIT_19                      0x80000L\r
106 #define BIT_20                      0x100000L\r
107 #define BIT_21                      0x200000L\r
108 #define BIT_22                      0x400000L\r
109 #define BIT_23                      0x800000L\r
110 \r
111 #define BIT_24                      0x1000000L\r
112 #define BIT_25                      0x2000000L\r
113 #define BIT_26                      0x4000000L\r
114 #define BIT_27                      0x8000000L\r
115 #define BIT_28                      0x10000000L\r
116 #define BIT_29                      0x20000000L\r
117 #define BIT_30                      0x40000000L\r
118 #define BIT_31                      0x80000000L\r
119 #endif\r
120 \r
121 #ifndef TRUE                        /* true and false */\r
122 #define TRUE                        (BOOL)1\r
123 #endif\r
124 \r
125 #ifndef FALSE\r
126 #define FALSE                       (BOOL)0\r
127 #endif\r
128 \r
129 #if defined(WIN32_SH4) && defined(__cplusplus)\r
130 #define _SIZE_T\r
131 #else\r
132 #ifndef _SIZE_T\r
133 #define _SIZE_T\r
134 typedef unsigned long size_t;\r
135 #endif\r
136 #endif\r
137 \r
138 #ifndef BOOL\r
139 #define BOOL                        BOOL\r
140 typedef unsigned char BOOL;\r
141 #endif\r
142 \r
143 #ifndef PBOOL\r
144 #define PBOOL                       PBOOL\r
145 typedef unsigned char *PBOOL;\r
146 #endif\r
147 \r
148 #ifndef TCHAR\r
149 #define TCHAR                       TCHAR\r
150 typedef char    TCHAR;\r
151 #endif\r
152 \r
153 #ifndef PTCHAR\r
154 #define PTCHAR                      PTCHAR\r
155 typedef char   *PTCHAR;\r
156 #endif\r
157 \r
158 #ifndef PCTCHAR\r
159 #define PCTCHAR                     PCTCHAR\r
160 typedef char   *const PCTCHAR;\r
161 #endif\r
162 \r
163 #ifndef CPCTCHAR\r
164 #define CPCTCHAR                    CPCTCHAR\r
165 typedef const char *const CPCTCHAR;\r
166 #endif\r
167 \r
168 #ifndef CHAR\r
169 #define CHAR                        CHAR\r
170 typedef char    CHAR;\r
171 #endif\r
172 \r
173 #ifndef CCHAR\r
174 #define CCHAR                       CCHAR\r
175 typedef const char CCHAR;\r
176 #endif\r
177 \r
178 #ifndef PCHAR\r
179 #define PCHAR                       PCHAR\r
180 typedef char    *PCHAR;\r
181 #endif\r
182 \r
183 #ifndef CPCHAR\r
184 #define CPCHAR                      CPCHAR\r
185 typedef const char *CPCHAR;\r
186 #endif\r
187 \r
188 #ifndef PCCHAR\r
189 #define PCCHAR                      PCCHAR\r
190 typedef char *const PCCHAR;\r
191 #endif\r
192 \r
193 #ifndef CPCCHAR\r
194 #define CPCCHAR                     CPCCHAR\r
195 typedef const char *const CPCCHAR;\r
196 #endif\r
197 \r
198 #ifndef PTSTR\r
199 #define PTSTR                       PTSTR\r
200 typedef const char *PTSTR;\r
201 #endif\r
202 \r
203 #ifndef PCTSTR\r
204 #define PCTSTR                      PCTSTR\r
205 typedef char *const PCTSTR;\r
206 #endif\r
207 \r
208 #ifndef PCTSTR\r
209 #define PCTSTR                      PCTSTR\r
210 typedef const char *PCTSTR;\r
211 #endif\r
212 \r
213 #ifndef PTSTR\r
214 #define PTSTR                       PTSTR\r
215 typedef char *PTSTR;\r
216 #endif\r
217 \r
218 #ifndef BYTE\r
219 #define BYTE                        BYTE\r
220 typedef unsigned char BYTE;\r
221 #endif\r
222 \r
223 #ifndef PBYTE\r
224 #define PBYTE                       PBYTE\r
225 typedef unsigned char *PBYTE;\r
226 #endif\r
227 \r
228 #ifndef PCBYTE\r
229 #define PCBYTE                      PCBYTE\r
230 typedef unsigned char *const PCBYTE;\r
231 #endif\r
232 \r
233 #ifndef CPBYTE\r
234 #define CPBYTE                      CPBYTE\r
235 typedef const unsigned char *CPBYTE;\r
236 #endif\r
237 \r
238 #ifndef SHORT\r
239 #define SHORT                       SHORT\r
240 typedef short   SHORT;\r
241 #endif\r
242 \r
243 #ifndef PSHORT\r
244 #define PSHORT                      PSHORT\r
245 typedef short *PSHORT;\r
246 #endif\r
247 \r
248 #ifndef PCSHORT\r
249 #define PCSHORT                     PCSHORT\r
250 typedef short *const PCSHORT;\r
251 #endif\r
252 \r
253 #ifndef CPSHORT\r
254 #define CPSHORT                     CPSHORT\r
255 typedef const short *CPSHORT;\r
256 #endif\r
257 \r
258 #ifndef USHORT\r
259 #define USHORT                      USHORT\r
260 typedef unsigned short USHORT;\r
261 #endif\r
262 \r
263 #ifndef PUSHORT\r
264 #define PUSHORT                     PUSHORT\r
265 typedef unsigned short *PUSHORT;\r
266 #endif\r
267 \r
268 #ifndef PCUSHORT\r
269 #define PCUSHORT                    PCUSHORT\r
270 typedef unsigned short *const PCUSHORT;\r
271 #endif\r
272 \r
273 #ifndef CPUSHORT\r
274 #define CPUSHORT                    CPUSHORT\r
275 typedef const unsigned short *CPUSHORT;\r
276 #endif\r
277 \r
278 #ifndef WORD\r
279 #define WORD                        WORD\r
280 typedef unsigned short WORD;\r
281 #endif\r
282 \r
283 #ifndef PWORD\r
284 #define PWORD                       PWORD\r
285 typedef unsigned short *PWORD;\r
286 #endif\r
287 \r
288 #ifndef PCWORD\r
289 #define PCWORD                      PCWORD\r
290 typedef unsigned short *const PCWORD;\r
291 #endif\r
292 \r
293 #ifndef INT\r
294 #define INT                         INT\r
295 typedef int INT;\r
296 #endif\r
297 \r
298 #ifndef CINT\r
299 #define CINT                        CINT\r
300 typedef const int CINT;\r
301 #endif\r
302 \r
303 #ifndef PINT\r
304 #define PINT                        PINT\r
305 typedef int *PINT;\r
306 #endif\r
307 \r
308 #ifndef PCINT\r
309 #define PCINT                       PCINT\r
310 typedef int *const PCINT;\r
311 #endif\r
312 \r
313 #ifndef CPINT\r
314 #define CPINT                       CPINT\r
315 typedef const int *CPINT;\r
316 #endif\r
317 \r
318 #ifndef UINT\r
319 #define UINT                        UINT\r
320 typedef unsigned int UINT;\r
321 #endif\r
322 \r
323 #ifndef PUINT\r
324 #define PUINT                       PUINT\r
325 typedef unsigned int *PUINT;\r
326 #endif\r
327 \r
328 #ifndef PCUINT\r
329 #define PCUINT                      PCUINT\r
330 typedef unsigned int *const PCUINT;\r
331 #endif\r
332 \r
333 #ifndef CPUINT\r
334 #define CPUINT                      CPUINT\r
335 typedef const unsigned int *CPUINT;\r
336 #endif\r
337 \r
338 #ifndef DWORD\r
339 #define DWORD                       DWORD\r
340 typedef unsigned long DWORD;\r
341 #endif\r
342 \r
343 #ifndef PDWORD\r
344 #define PDWORD                      PDWORD\r
345 typedef unsigned long *PDWORD;\r
346 #endif\r
347 \r
348 #ifndef PCDWORD\r
349 #define PCDWORD                     PCDWORD\r
350 typedef unsigned long *const PCDWORD;\r
351 #endif\r
352 \r
353 #ifndef CPDWORD\r
354 #define CPDWORD                     CPDWORD\r
355 typedef const unsigned long *CPDWORD;\r
356 #endif\r
357 \r
358 #ifndef LONG\r
359 #define LONG                        LONG\r
360 typedef long LONG;\r
361 #endif\r
362 \r
363 #ifndef PLONG\r
364 #define PLONG                       PLONG\r
365 typedef long *PLONG;\r
366 #endif\r
367 \r
368 #ifndef PCLONG\r
369 #define PCLONG                      PCLONG\r
370 typedef long *const PCLONG;\r
371 #endif\r
372 \r
373 #ifndef CPLONG\r
374 #define CPLONG                      CPLONG\r
375 typedef const long *CPLONG;\r
376 #endif\r
377 \r
378 #ifndef ULONG\r
379 #define ULONG                       ULONG\r
380 typedef unsigned long ULONG;\r
381 #endif\r
382 \r
383 #ifndef PULONG\r
384 #define PULONG                      PULONG\r
385 typedef unsigned long *PULONG;\r
386 #endif\r
387 \r
388 #ifndef PCULONG\r
389 #define PCULONG   PCULONG\r
390 typedef unsigned long *const        PCULONG;\r
391 #endif\r
392 \r
393 #ifndef CPULONG\r
394 #define CPULONG                     CPULONG\r
395 typedef const unsigned long *CPULONG;\r
396 #endif\r
397 \r
398 #ifndef FLOAT\r
399 #define FLOAT                       FLOAT\r
400 typedef float FLOAT;\r
401 #endif\r
402 \r
403 #ifndef DOUBLE\r
404 #define DOUBLE                      DOUBLE\r
405 typedef long double DOUBLE;\r
406 #endif\r
407 \r
408 #ifndef PDOUBLE\r
409 #define PDOUBLE                     PDOUBLE\r
410 typedef long double *PDOUBLE;\r
411 #endif\r
412 \r
413 #ifndef CPDOUBLE\r
414 #define CPDOUBLE                    CPDOUBLE\r
415 typedef const long double *CPDOUBLE;\r
416 #endif\r
417 \r
418 #ifndef PCDOUBLE\r
419 #define PCDOUBLE                    PCDOUBLE\r
420 typedef long double *const PCDOUBLE;\r
421 #endif\r
422 \r
423 #ifndef PVOID\r
424 #define PVOID   PVOID\r
425 typedef void *PVOID;\r
426 #endif\r
427 \r
428 #ifndef VOID\r
429 #define VOID                        VOID\r
430 typedef void VOID;\r
431 #endif\r
432 \r
433 #ifndef IOID\r
434 #define IOID                        IOID\r
435 typedef unsigned short IOID;\r
436 #endif\r
437 \r
438 #ifndef PIOID\r
439 #define PIOID                       PIOID\r
440 typedef unsigned short *PIOID;\r
441 #endif\r
442 \r
443 #ifndef BBYTE\r
444 #define BBYTE   BBYTE\r
445 typedef union {\r
446     unsigned char   BYTE;       /*lint -e46 */\r
447                                 /* this is correct */\r
448     struct {\r
449         #ifdef _BITFIELDS_MSB_FIRST_\r
450         unsigned char B7:1;\r
451         unsigned char B6:1;\r
452         unsigned char B5:1;\r
453         unsigned char B4:1;\r
454         unsigned char B3:1;\r
455         unsigned char B2:1;\r
456         unsigned char B1:1;\r
457         unsigned char B0:1;\r
458         #else\r
459         unsigned char B0:1;\r
460         unsigned char B1:1;\r
461         unsigned char B2:1;\r
462         unsigned char B3:1;\r
463         unsigned char B4:1;\r
464         unsigned char B5:1;\r
465         unsigned char B6:1;\r
466         unsigned char B7:1;\r
467         #endif\r
468     } BIT;\r
469 } BBYTE;\r
470 #endif\r
471 \r
472 #endif /* TYPES_H_INCLUDED */\r
473 \r
474 /******************************************************************************\r
475 End  Of File\r
476 ******************************************************************************/\r