LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tistdtypes.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 by Texas Instruments Incorporated.
3  * All rights reserved. Property of Texas Instruments Incorporated.
4  * Restricted rights to use, duplicate or disclose this code are
5  * granted through contract.
6  *
7  */
8 /*
9  * ======== tistdtypes.h ========
10  *
11  */
12 
13 /*
14  * These types are also defined by other TI components. They are bracketed
15  * with _TI_STD_TYPES to avoid warnings for duplicate definition. The
16  * The Uint16, etc. definitions were provided in early 2.x versions of CSL
17  * that did not have _TI_STD_TYPES protection.
18  *
19  * You may get warnings about duplicate type definitions when using this
20  * header file with 2.x CSL. You can use the '-pds303' compiler option to
21  * suppress these warnings.
22  */
23 #ifndef _TISTDTYPES_H_
24 #define _TISTDTYPES_H_
25 
26 // Prevent C++ name mangling
27 #ifdef __cplusplus
28 extern far "c" {
29 #endif
30 
31 /*
32  * Null declaration
33  */
34 #ifndef NULL
35 #define NULL (0)
36 #endif
37 
38 /*
39  * Return type defines
40  */
41 #ifndef E_PASS
42 #define E_PASS (0x00000000u)
43 #endif
44 #ifndef E_FAIL
45 #define E_FAIL (0x00000001u)
46 #endif
47 #ifndef E_TIMEOUT
48 #define E_TIMEOUT (0x00000002u)
49 #endif
50 
51 // Aliases for standard C types
52  typedef int Int;
53  typedef unsigned Uns;
54  typedef char Char;
55  typedef char *String; /* pointer to null-terminated character sequence */
56  typedef void *Ptr; /* pointer to arbitrary type */
57  typedef unsigned short Bool; /* boolean */
58 
59 // Boolean declarations
60 #ifndef TRUE
61 #define TRUE ((Bool) 1)
62 #endif
63 #ifndef FALSE
64 #define FALSE ((Bool) 0)
65 #endif
66 
67 // GENERIC BUS width defines
68 #ifndef BUS_8BIT
69 #define BUS_8BIT (0x01)
70 #endif
71 #ifndef BUS_16BIT
72 #define BUS_16BIT (0x02)
73 #endif
74 #ifndef BUS_32BIT
75 #define BUS_32BIT (0x04)
76 #endif
77 #ifndef BUS_64BIT
78 #define BUS_64BIT (0x08)
79 #endif
80 
81 // Generic bit mask defines
82 #ifndef BIT0
83 #define BIT0 (0x00000001)
84 #define BIT1 (0x00000002)
85 #define BIT2 (0x00000004)
86 #define BIT3 (0x00000008)
87 #define BIT4 (0x00000010)
88 #define BIT5 (0x00000020)
89 #define BIT6 (0x00000040)
90 #define BIT7 (0x00000080)
91 #define BIT8 (0x00000100)
92 #define BIT9 (0x00000200)
93 #define BIT10 (0x00000400)
94 #define BIT11 (0x00000800)
95 #define BIT12 (0x00001000)
96 #define BIT13 (0x00002000)
97 #define BIT14 (0x00004000)
98 #define BIT15 (0x00008000)
99 #define BIT16 (0x00010000)
100 #define BIT17 (0x00020000)
101 #define BIT18 (0x00040000)
102 #define BIT19 (0x00080000)
103 #define BIT20 (0x00100000)
104 #define BIT21 (0x00200000)
105 #define BIT22 (0x00400000)
106 #define BIT23 (0x00800000)
107 #define BIT24 (0x01000000)
108 #define BIT25 (0x02000000)
109 #define BIT26 (0x04000000)
110 #define BIT27 (0x08000000)
111 #define BIT28 (0x10000000)
112 #define BIT29 (0x20000000)
113 #define BIT30 (0x40000000)
114 #define BIT31 (0x80000000)
115 #endif
116 
117 /*
118  * Uint8, Uint16, Uint32, etc are defined to be "smallest unit of
119  * available storage that is large enough to hold unsigned or integer
120  * of specified size".
121  */
122 
123 /* Handle the 6x ISA */
124 #if defined(_TMS320C6X)
125  /* Unsigned integer definitions (32bit, 16bit, 8bit) follow... */
126  typedef unsigned int Uint32;
127  typedef unsigned short Uint16;
128  typedef unsigned char Uint8;
129 
130  /* Signed integer definitions (32bit, 16bit, 8bit) follow... */
131  typedef int Int32;
132  typedef short Int16;
133  typedef char Int8;
134 
135  /* Volatile unsigned integer definitions (32bit, 16bit, 8bit) follow... */
136  typedef volatile unsigned int VUint32;
137  typedef volatile unsigned short VUint16;
138  typedef volatile unsigned char VUint8;
139 
140  /* Volatile signed integer definitions (32bit, 16bit, 8bit) follow... */
141  typedef volatile int VInt32;
142  typedef volatile short VInt16;
143  typedef volatile char VInt8;
144 
145 #define __FAR__ far
146 #define __NEAR__ near
147 
148 /* Handle the 54x, 55x ISAs */
149 #elif defined(_TMS320C5XX) || defined(__TMS320C55X__)
150  /* Unsigned integer definitions (32bit, 16bit, 8bit) follow... */
151  typedef unsigned long Uint32;
152  typedef unsigned short Uint16;
153  typedef unsigned char Uint8;
154 
155  /* Signed integer definitions (32bit, 16bit, 8bit) follow... */
156  typedef long Int32;
157  typedef short Int16;
158  typedef char Int8;
159 /* Handle 28x ISA */
160 #elif defined(_TMS320C28X)
161  /* Unsigned integer definitions (32bit, 16bit, 8bit) follow... */
162  typedef unsigned long Uint32;
163  typedef unsigned int Uint16;
164  typedef unsigned char Uint8;
165 
166  /* Signed integer definitions (32bit, 16bit, 8bit) follow... */
167  typedef long Int32;
168  typedef int Int16;
169  typedef char Int8;
170 /* Handle ARM TMS470 ISA (GNU compiler is assumed to exist for ARM only)*/
171 #elif (defined(__TMS470__) || defined(__GNUC__))
172  /* Unsigned integer definitions (32bit, 16bit, 8bit) follow... */
173  typedef unsigned int Uint32;
174  typedef unsigned short Uint16;
175  typedef unsigned char Uint8;
176 
177  /* Signed integer definitions (32bit, 16bit, 8bit) follow... */
178  typedef int Int32;
179  typedef short Int16;
180  typedef char Int8;
181 
182  /* Volatile unsigned integer definitions (32bit, 16bit, 8bit) follow... */
183  typedef volatile unsigned int VUint32;
184  typedef volatile unsigned short VUint16;
185  typedef volatile unsigned char VUint8;
186 
187  /* Volatile signed integer definitions (32bit, 16bit, 8bit) follow... */
188  typedef volatile int VInt32;
189  typedef volatile short VInt16;
190  typedef volatile char VInt8;
191 
192  /* empty defines */
193 #define __FAR__
194 #define __NEAR__
195 #else
196  /* Other ISAs not supported */
197 #error <tistdtypes.h> is not supported for this target
198 #endif
199 
200 #ifdef __cplusplus
201 }
202 #endif
203 #endif /* _TISTDTYPES_H_ */
char Char
Definition: tistdtypes.h:54
char * String
Definition: tistdtypes.h:55
unsigned short Bool
Definition: tistdtypes.h:57
int Int
Definition: tistdtypes.h:52
unsigned Uns
Definition: tistdtypes.h:53
void * Ptr
Definition: tistdtypes.h:56