1 /******************************************************************************
2 ** File Name: sci_types.h *
5 ** Copyright: 2001 Spreatrum, Incoporated. All Rights Reserved. *
6 ** Description: This header file contains general types and macros that *
7 ** are of use to all modules.The values or definitions are *
8 ** dependent on the specified target. T_WINNT specifies *
9 ** Windows NT based targets, otherwise the default is for *
11 ******************************************************************************
13 ******************************************************************************
15 ** ------------------------------------------------------------------------- *
16 ** DATE NAME DESCRIPTION *
17 ** 10/22/2001 Jakle zhu Create. *
18 ******************************************************************************/
22 /**---------------------------------------------------------------------------*
24 **---------------------------------------------------------------------------*/
31 /* ------------------------------------------------------------------------
33 ** ------------------------------------------------------------------------ */
43 #define TRUE 1 /* Boolean true value. */
44 #define FALSE 0 /* Boolean false value. */
46 #define SCI_TRUE TRUE // Boolean true value
47 #define SCI_FALSE FALSE // Boolean false value
53 /* -----------------------------------------------------------------------
55 ** ----------------------------------------------------------------------- */
56 typedef unsigned char BOOLEAN;
57 typedef unsigned char uint8;
58 typedef unsigned short uint16;
59 typedef unsigned long int uint32;
61 typedef unsigned __int64 uint64;
63 typedef struct _X_UN_64_T {
67 typedef X_UN_64_T uint64;
68 typedef uint64 __uint64;
71 typedef signed char int8;
72 typedef signed short int16;
73 typedef signed long int int32;
76 typedef __int64 int64;
78 typedef struct _X_64_T {
83 typedef int64 __int64;
93 #endif //WIN_UNIT_TEST
95 #define VOLATILE volatile
100 //Added by Xueliang.Wang on 28/03/2002
102 //#define PRIVATE static
105 // @Xueliang.Wang moved it from os_api.h(2002-12-30)
107 typedef uint32 BLOCK_ID;
113 #define BIT_0 0x00000001
114 #define BIT_1 0x00000002
115 #define BIT_2 0x00000004
116 #define BIT_3 0x00000008
117 #define BIT_4 0x00000010
118 #define BIT_5 0x00000020
119 #define BIT_6 0x00000040
120 #define BIT_7 0x00000080
121 #define BIT_8 0x00000100
122 #define BIT_9 0x00000200
123 #define BIT_10 0x00000400
124 #define BIT_11 0x00000800
125 #define BIT_12 0x00001000
126 #define BIT_13 0x00002000
127 #define BIT_14 0x00004000
128 #define BIT_15 0x00008000
129 #define BIT_16 0x00010000
130 #define BIT_17 0x00020000
131 #define BIT_18 0x00040000
132 #define BIT_19 0x00080000
133 #define BIT_20 0x00100000
134 #define BIT_21 0x00200000
135 #define BIT_22 0x00400000
136 #define BIT_23 0x00800000
137 #define BIT_24 0x01000000
138 #define BIT_25 0x02000000
139 #define BIT_26 0x04000000
140 #define BIT_27 0x08000000
141 #define BIT_28 0x10000000
142 #define BIT_29 0x20000000
143 #define BIT_30 0x40000000
144 #define BIT_31 0x80000000
150 #define PACK __packed /* Byte alignment for communication structures.*/
153 /* some usefule marcos */
154 #define Bit(_i) ((u32) 1<<(_i))
156 #define MAX( _x, _y ) ( ((_x) > (_y)) ? (_x) : (_y) )
158 #define MIN( _x, _y ) ( ((_x) < (_y)) ? (_x) : (_y) )
159 #define WORD_LO(_xxx) ((uint8) ((int16)(_xxx)))
160 #define WORD_HI(_xxx) ((uint8) ((int16)(_xxx) >> 8))
162 #define RND8( _x ) ((((_x) + 7) / 8 ) * 8 ) /*rounds a number up to the nearest multiple of 8 */
165 #define UPCASE( _c ) ( ((_c) >= 'a' && (_c) <= 'z') ? ((_c) - 0x20) : (_c) )
167 #define DECCHK( _c ) ((_c) >= '0' && (_c) <= '9')
169 #define DTMFCHK( _c ) ( ((_c) >= '0' && (_c) <= '9') ||\
170 ((_c) >= 'A' && (_c) <= 'D') ||\
171 ((_c) >= 'a' && (_c) <= 'd') ||\
175 #define HEXCHK( _c ) ( ((_c) >= '0' && (_c) <= '9') ||\
176 ((_c) >= 'A' && (_c) <= 'F') ||\
177 ((_c) >= 'a' && (_c) <= 'f') )
179 #define ARR_SIZE( _a ) ( sizeof( (_a) ) / sizeof( (_a[0]) ) )
182 @Lin.liu Added.(2002-11-19)
184 #define BCD_EXT uint8
187 /**---------------------------------------------------------------------------*
189 **---------------------------------------------------------------------------*/
194 #endif /* SCI_TYPES_H */