/[H8]/trunk/docs/Microchip TCP_IP stack/Include/GenericTypeDefs.h
ViewVC logotype

Annotation of /trunk/docs/Microchip TCP_IP stack/Include/GenericTypeDefs.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15 - (hide annotations) (download)
Thu Apr 19 09:01:15 2007 UTC (17 years, 2 months ago) by hedin
File MIME type: text/plain
File size: 7498 byte(s)
added the TCP/IP stack, source code.
1 hedin 15 /*********************************************************************
2     *
3     * Generic Type Definitions
4     *
5     *********************************************************************
6     * FileName: GenericTypeDefs.h
7     * Dependencies: None
8     * Processor: PIC18, PIC24F, PIC24H, dsPIC30F, dsPIC33F
9     * Complier: Microchip C18, C30
10     * HI-TECH PICC-18
11     * Company: Microchip Technology, Inc.
12     *
13     * Software License Agreement
14     *
15     * Copyright © 2002-2007 Microchip Technology Inc. All rights
16     * reserved.
17     *
18     * Microchip licenses to you the right to use, modify, copy, and
19     * distribute:
20     * (i) the Software when embedded on a Microchip microcontroller or
21     * digital signal controller product (“Device”) which is
22     * integrated into Licensee’s product; or
23     * (ii) ONLY the Software driver source files ENC28J60.c and
24     * ENC28J60.h ported to a non-Microchip device used in
25     * conjunction with a Microchip ethernet controller for the
26     * sole purpose of interfacing with the ethernet controller.
27     *
28     * You should refer to the license agreement accompanying this
29     * Software for additional information regarding your rights and
30     * obligations.
31     *
32     * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT
33     * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
34     * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A
35     * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
36     * MICROCHIP BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR
37     * CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF
38     * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS
39     * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE
40     * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER
41     * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT
42     * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE.
43     *
44     *
45     * Author Date Comment
46     *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47     * Nilesh Rajbharti 07/12/04 Rel 0.9
48     * Nilesh Rajbharti 11/24/04 Rel 0.9.1
49     * Rawin Rojvanit 09/17/05 Rel 0.9.2
50     * D Flowers & H Schlunder 08/10/06 Much better now (1.0)
51     * D Flowers & H Schlunder 09/11/06 Add base signed types (1.1)
52     * D Flo, H Sch, et. al 02/28/07 Add QWORD, LONGLONG, QWORD_VAL (1.2)
53     ********************************************************************/
54    
55     #ifndef __GENERIC_TYPE_DEFS_H_
56     #define __GENERIC_TYPE_DEFS_H_
57    
58     typedef enum _BOOL { FALSE = 0, TRUE } BOOL; // Undefined size
59    
60     typedef unsigned char BYTE; // 8-bit unsigned
61     typedef unsigned short int WORD; // 16-bit unsigned
62     typedef unsigned long DWORD; // 32-bit unsigned
63     typedef unsigned long long QWORD; // 64-bit unsigned
64     typedef signed char CHAR; // 8-bit signed
65     typedef signed short int SHORT; // 16-bit signed
66     typedef signed long LONG; // 32-bit signed
67     typedef signed long long LONGLONG; // 64-bit signed
68    
69     typedef union _BYTE_VAL
70     {
71     BYTE Val;
72     struct
73     {
74     unsigned char b0:1;
75     unsigned char b1:1;
76     unsigned char b2:1;
77     unsigned char b3:1;
78     unsigned char b4:1;
79     unsigned char b5:1;
80     unsigned char b6:1;
81     unsigned char b7:1;
82     } bits;
83     } BYTE_VAL;
84    
85     typedef union _WORD_VAL
86     {
87     WORD Val;
88     BYTE v[2];
89     struct
90     {
91     BYTE LB;
92     BYTE HB;
93     } byte;
94     struct
95     {
96     unsigned char b0:1;
97     unsigned char b1:1;
98     unsigned char b2:1;
99     unsigned char b3:1;
100     unsigned char b4:1;
101     unsigned char b5:1;
102     unsigned char b6:1;
103     unsigned char b7:1;
104     unsigned char b8:1;
105     unsigned char b9:1;
106     unsigned char b10:1;
107     unsigned char b11:1;
108     unsigned char b12:1;
109     unsigned char b13:1;
110     unsigned char b14:1;
111     unsigned char b15:1;
112     } bits;
113     } WORD_VAL;
114    
115     typedef union _DWORD_VAL
116     {
117     DWORD Val;
118     WORD w[2];
119     BYTE v[4];
120     struct
121     {
122     WORD LW;
123     WORD HW;
124     } word;
125     struct
126     {
127     BYTE LB;
128     BYTE HB;
129     BYTE UB;
130     BYTE MB;
131     } byte;
132     struct
133     {
134     unsigned char b0:1;
135     unsigned char b1:1;
136     unsigned char b2:1;
137     unsigned char b3:1;
138     unsigned char b4:1;
139     unsigned char b5:1;
140     unsigned char b6:1;
141     unsigned char b7:1;
142     unsigned char b8:1;
143     unsigned char b9:1;
144     unsigned char b10:1;
145     unsigned char b11:1;
146     unsigned char b12:1;
147     unsigned char b13:1;
148     unsigned char b14:1;
149     unsigned char b15:1;
150     unsigned char b16:1;
151     unsigned char b17:1;
152     unsigned char b18:1;
153     unsigned char b19:1;
154     unsigned char b20:1;
155     unsigned char b21:1;
156     unsigned char b22:1;
157     unsigned char b23:1;
158     unsigned char b24:1;
159     unsigned char b25:1;
160     unsigned char b26:1;
161     unsigned char b27:1;
162     unsigned char b28:1;
163     unsigned char b29:1;
164     unsigned char b30:1;
165     unsigned char b31:1;
166     } bits;
167     } DWORD_VAL;
168    
169     typedef union _QWORD_VAL
170     {
171     QWORD Val;
172     DWORD d[2];
173     WORD w[4];
174     BYTE v[8];
175     struct
176     {
177     WORD LD;
178     WORD HD;
179     } dword;
180     struct
181     {
182     WORD LW;
183     WORD HW;
184     WORD UW;
185     WORD MW;
186     } word;
187     struct
188     {
189     unsigned char b0:1;
190     unsigned char b1:1;
191     unsigned char b2:1;
192     unsigned char b3:1;
193     unsigned char b4:1;
194     unsigned char b5:1;
195     unsigned char b6:1;
196     unsigned char b7:1;
197     unsigned char b8:1;
198     unsigned char b9:1;
199     unsigned char b10:1;
200     unsigned char b11:1;
201     unsigned char b12:1;
202     unsigned char b13:1;
203     unsigned char b14:1;
204     unsigned char b15:1;
205     unsigned char b16:1;
206     unsigned char b17:1;
207     unsigned char b18:1;
208     unsigned char b19:1;
209     unsigned char b20:1;
210     unsigned char b21:1;
211     unsigned char b22:1;
212     unsigned char b23:1;
213     unsigned char b24:1;
214     unsigned char b25:1;
215     unsigned char b26:1;
216     unsigned char b27:1;
217     unsigned char b28:1;
218     unsigned char b29:1;
219     unsigned char b30:1;
220     unsigned char b31:1;
221     unsigned char b32:1;
222     unsigned char b33:1;
223     unsigned char b34:1;
224     unsigned char b35:1;
225     unsigned char b36:1;
226     unsigned char b37:1;
227     unsigned char b38:1;
228     unsigned char b39:1;
229     unsigned char b40:1;
230     unsigned char b41:1;
231     unsigned char b42:1;
232     unsigned char b43:1;
233     unsigned char b44:1;
234     unsigned char b45:1;
235     unsigned char b46:1;
236     unsigned char b47:1;
237     unsigned char b48:1;
238     unsigned char b49:1;
239     unsigned char b50:1;
240     unsigned char b51:1;
241     unsigned char b52:1;
242     unsigned char b53:1;
243     unsigned char b54:1;
244     unsigned char b55:1;
245     unsigned char b56:1;
246     unsigned char b57:1;
247     unsigned char b58:1;
248     unsigned char b59:1;
249     unsigned char b60:1;
250     unsigned char b61:1;
251     unsigned char b62:1;
252     unsigned char b63:1;
253     } bits;
254     } QWORD_VAL;
255     #endif //__GENERIC_TYPE_DEFS_H_

  ViewVC Help
Powered by ViewVC 1.1.20