00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00046 #ifndef __FSTDINT_H__
00047 #define __FSTDINT_H__
00048
00049
00050
00051
00052 #include "mcu.h"
00053
00054
00055
00056
00057
00058
00059
00060 #define INT8_MIN (-128)
00061 #define INT8_MAX (127)
00062 #define UINT8_MAX (255)
00063
00064 #define INT16_MIN (-32768)
00065 #define INT16_MAX (32767)
00066 #define UINT16_MAX (65535)
00067
00068 #define INT32_MIN (-2147483648L)
00069 #define INT32_MAX (2147483647L)
00070 #define UINT32_MAX (4294967295UL)
00071
00072 #ifdef __64BIT_INT_TYPE_SUPPORT__
00073 #define INT64_MIN (-9223372036854775808LL)
00074 #define INT64_MAX (9223372036854775807LL)
00075 #define UINT64_MAX (18446744073709551615ULL)
00076 #endif
00077
00078
00079
00080 #define INT_LEAST8_MIN (-128)
00081 #define INT_LEAST8_MAX (127)
00082 #define UINT_LEAST8_MAX (255)
00083
00084 #define INT_LEAST16_MIN (-32768)
00085 #define INT_LEAST16_MAX (32767)
00086 #define UINT_LEAST16_MAX (65535)
00087
00088 #define INT_LEAST32_MIN (-2147483648L)
00089 #define INT_LEAST32_MAX (2147483647L)
00090 #define UINT_LEAST32_MAX (4294967295U)
00091
00092 #ifdef __64BIT_INT_TYPE_SUPPORT__
00093 #define INT_LEAST64_MIN (-9223372036854775808LL)
00094 #define INT_LEAST64_MAX (9223372036854775807LL)
00095 #define UINT_LEAST64_MAX (18446744073709551615ULL)
00096 #endif
00097
00098
00099
00100 #if (CPU_TYPE == CPU_TYPE_16BIT)
00101 #define INT_FAST8_MIN (-32768)
00102 #define INT_FAST8_MAX (32767)
00103 #define UINT_FAST8_MAX (65535)
00104 #elif (CPU_TYPE == CPU_TYPE_32BIT)
00105 #define INT_FAST8_MIN (-2147483648L)
00106 #define INT_FAST8_MAX (2147483647L)
00107 #define UINT_FAST8_MAX (4294967295UL)
00108 #else
00109 #define INT_FAST8_MIN (-128)
00110 #define INT_FAST8_MAX (127)
00111 #define UINT_FAST8_MAX (255)
00112 #endif
00113
00114 #if (CPU_TYPE == CPU_TYPE_32BIT)
00115 #define INT_FAST16_MIN (-2147483648L)
00116 #define INT_FAST16_MAX (2147483647L)
00117 #define UINT_FAST16_MAX (4294967295U)
00118 #else
00119 #define INT_FAST16_MIN (-32768)
00120 #define INT_FAST16_MAX (32767)
00121 #define UINT_FAST16_MAX (65535)
00122 #endif
00123
00124 #define INT_FAST32_MIN (-2147483648L)
00125 #define INT_FAST32_MAX (2147483647L)
00126 #define UINT_FAST32_MAX (4294967295UL)
00127
00128 #ifdef __64BIT_INT_TYPE_SUPPORT__
00129 #define INT_FAST64_MIN (-9223372036854775808LL)
00130 #define INT_FAST64_MAX (9223372036854775807LL)
00131 #define UINT_FAST64_MAX (18446744073709551615ULL)
00132 #endif
00133
00134
00135
00136 #define INT8_C(value) (value)
00137 #define INT16_C(value) (value)
00138 #define INT32_C(value) (value ## L)
00139 #ifdef __64BIT_INT_TYPE_SUPPORT__
00140 #define INT64_C(value) (value ## LL)
00141 #endif
00142
00143
00144
00145 #define UINT8_C(value) (value)
00146 #define UINT16_C(value) (value)
00147 #define UINT32_C(value) (value ## UL)
00148 #ifdef __64BIT_INT_TYPE_SUPPORT__
00149 #define UINT64_C(value) (value ## ULL)
00150 #endif
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160 typedef signed char int8_t;
00161 typedef signed short int16_t;
00162 typedef signed long int32_t;
00163 #ifdef __64BIT_INT_TYPE_SUPPORT__
00164 typedef signed long long int64_t;
00165 #endif
00166
00167
00168
00169 typedef unsigned char uint8_t;
00170 typedef unsigned short uint16_t;
00171 typedef unsigned long uint32_t;
00172 #ifdef __64BIT_INT_TYPE_SUPPORT__
00173 typedef unsigned long long uint64_t;
00174 #endif
00175
00176
00177
00178
00179 typedef signed char int_least8_t;
00180 typedef signed short int_least16_t;
00181 typedef signed long int_least32_t;
00182 #ifdef __64BIT_INT_TYPE_SUPPORT__
00183 typedef signed long long int_least64_t;
00184 #endif
00185
00186
00187
00188 typedef unsigned char uint_least8_t;
00189 typedef unsigned short uint_least16_t;
00190 typedef unsigned long uint_least32_t;
00191 #ifdef __64BIT_INT_TYPE_SUPPORT__
00192 typedef unsigned long long uint_least64_t;
00193 #endif
00194
00195
00196
00197
00198 #if (CPU_TYPE == CPU_TYPE_16BIT)
00199 typedef signed short int_fast8_t;
00200 #elif (CPU_TYPE == CPU_TYPE_32BIT)
00201 typedef signed long int_fast8_t;
00202 #else
00203 typedef signed char int_fast8_t;
00204 #endif
00205
00206 #if (CPU_TYPE == CPU_TYPE_32BIT)
00207 typedef signed long int_fast16_t;
00208 #else
00209 typedef signed short int_fast16_t;
00210 #endif
00211
00212 typedef signed long int_fast32_t;
00213
00214 #ifdef __64BIT_INT_TYPE_SUPPORT__
00215 typedef signed long long int_fast64_t;
00216 #endif
00217
00218
00219
00220 #if (CPU_TYPE == CPU_TYPE_16BIT)
00221 typedef unsigned short uint_fast8_t;
00222 #elif (CPU_TYPE == CPU_TYPE_32BIT)
00223 typedef unsigned long uint_fast8_t;
00224 #else
00225 typedef unsigned char uint_fast8_t;
00226 #endif
00227
00228 #if (CPU_TYPE == CPU_TYPE_32BIT)
00229 typedef unsigned long uint_fast16_t;
00230 #else
00231 typedef unsigned short uint_fast16_t;
00232 #endif
00233
00234 typedef unsigned long uint_fast32_t;
00235 #ifdef __64BIT_INT_TYPE_SUPPORT__
00236 typedef unsigned long long uint_fast64_t;
00237 #endif
00238
00239
00240
00241
00242 #ifdef __64BIT_INT_TYPE_SUPPORT__
00243 typedef signed long long intmax_t;
00244 #else
00245 typedef signed long intmax_t;
00246 #endif
00247
00248
00249
00250 #ifdef __64BIT_INT_TYPE_SUPPORT__
00251 typedef unsigned long long uintmax_t;
00252 #else
00253 typedef unsigned long uintmax_t;
00254 #endif
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265 #endif // __FSTDINT_H__