stdint.h

Go to the documentation of this file.
00001 /* ISO C9x  7.18  Integer types <stdint.h>
00002  * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
00003  *
00004  *  THIS SOFTWARE IS NOT COPYRIGHTED
00005  *
00006  *  Contributor: ATMEL Norway AS
00007  *
00008  *  This source code is offered for use in the public domain. You may
00009  *  use, modify or distribute it freely.
00010  *
00011  *  This code is distributed in the hope that it will be useful but
00012  *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
00013  *  DISCLAIMED. This includes but is not limited to warranties of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00015  *
00016  *  Date: 2005-12-20
00017  */
00018 
00019 
00020 #ifndef _STDINT_H
00021 #define _STDINT_H
00022 #include <stddef.h>
00023 
00024 /* 7.18.1.1  Exact-width integer types */
00025 typedef signed char        int8_t;
00026 typedef unsigned char      uint8_t;
00027 typedef signed short       int16_t;
00028 typedef unsigned short     uint16_t;
00029 typedef signed long        int32_t;
00030 typedef unsigned long      uint32_t;
00031 typedef signed long long   int64_t;
00032 typedef unsigned long long uint64_t;
00033 
00034 /* 7.18.1.2  Minimum-width integer types */
00035 typedef signed char        int_least8_t;
00036 typedef unsigned char      uint_least8_t;
00037 typedef signed short       int_least16_t;
00038 typedef unsigned short     uint_least16_t;
00039 typedef signed long        int_least32_t;
00040 typedef unsigned long      uint_least32_t;
00041 typedef signed long long   int_least64_t;
00042 typedef unsigned long long uint_least64_t;
00043 
00044 /*  7.18.1.3  Fastest minimum-width integer types
00045  *  Not actually guaranteed to be fastest for all purposes
00046  *  Here we use the exact-width types for 8 and 16-bit ints.
00047  */
00048 typedef signed char        int_fast8_t;
00049 typedef unsigned char      uint_fast8_t;
00050 typedef signed short       int_fast16_t;
00051 typedef unsigned short     uint_fast16_t;
00052 typedef signed long        int_fast32_t;
00053 typedef unsigned long      uint_fast32_t;
00054 typedef signed long long   int_fast64_t;
00055 typedef unsigned long long uint_fast64_t;
00056 
00057 /* 7.18.1.4  Integer types capable of holding object pointers */
00058 // Already defined by IAR, and differs between specific devices.
00059 //typedef signed int         intptr_t;
00060 //typedef unsigned           uintptr_t;
00061 
00062 /* 7.18.1.5  Greatest-width integer types */
00063 typedef signed long long   intmax_t;
00064 typedef unsigned long long uintmax_t;
00065 
00066 /* 7.18.2  Limits of specified-width integer types */
00067 #if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
00068 
00069 /* 7.18.2.1  Limits of exact-width integer types */
00070 #define INT8_MIN (-128)
00071 #define INT16_MIN (-32768)
00072 #define INT32_MIN (-2147483647 - 1)
00073 #define INT64_MIN  (-9223372036854775807LL - 1)
00074 
00075 #define INT8_MAX 127
00076 #define INT16_MAX 32767
00077 #define INT32_MAX 2147483647
00078 #define INT64_MAX 9223372036854775807LL
00079 
00080 #define UINT8_MAX 0xff /* 255U */
00081 #define UINT16_MAX 0xffff /* 65535U */
00082 #define UINT32_MAX 0xffffffff  /* 4294967295U */
00083 #define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
00084 
00085 /* 7.18.2.2  Limits of minimum-width integer types */
00086 #define INT_LEAST8_MIN INT8_MIN
00087 #define INT_LEAST16_MIN INT16_MIN
00088 #define INT_LEAST32_MIN INT32_MIN
00089 #define INT_LEAST64_MIN INT64_MIN
00090 
00091 #define INT_LEAST8_MAX INT8_MAX
00092 #define INT_LEAST16_MAX INT16_MAX
00093 #define INT_LEAST32_MAX INT32_MAX
00094 #define INT_LEAST64_MAX INT64_MAX
00095 
00096 #define UINT_LEAST8_MAX UINT8_MAX
00097 #define UINT_LEAST16_MAX UINT16_MAX
00098 #define UINT_LEAST32_MAX UINT32_MAX
00099 #define UINT_LEAST64_MAX UINT64_MAX
00100 
00101 /* 7.18.2.3  Limits of fastest minimum-width integer types */
00102 #define INT_FAST8_MIN INT8_MIN
00103 #define INT_FAST16_MIN INT16_MIN
00104 #define INT_FAST32_MIN INT32_MIN
00105 #define INT_FAST64_MIN INT64_MIN
00106 
00107 #define INT_FAST8_MAX INT8_MAX
00108 #define INT_FAST16_MAX INT16_MAX
00109 #define INT_FAST32_MAX INT32_MAX
00110 #define INT_FAST64_MAX INT64_MAX
00111 
00112 #define UINT_FAST8_MAX UINT8_MAX
00113 #define UINT_FAST16_MAX UINT16_MAX
00114 #define UINT_FAST32_MAX UINT32_MAX
00115 #define UINT_FAST64_MAX UINT64_MAX
00116 
00117 /* 7.18.2.4  Limits of integer types capable of holding
00118     object pointers */
00119 #define INTPTR_MIN INT32_MIN
00120 #define INTPTR_MAX INT32_MAX
00121 #define UINTPTR_MAX UINT32_MAX
00122 
00123 /* 7.18.2.5  Limits of greatest-width integer types */
00124 #define INTMAX_MIN INT64_MIN
00125 #define INTMAX_MAX INT64_MAX
00126 #define UINTMAX_MAX UINT64_MAX
00127 
00128 /* 7.18.3  Limits of other integer types */
00129 #define PTRDIFF_MAX ((ptrdiff_t)-1)
00130 #define PTRDIFF_MIN (-PTRDIFF_MAX)
00131 
00132 #define SIZE_MAX ((size_t)-1)
00133 
00134 #endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
00135 
00136 
00137 /* 7.18.4  Macros for integer constants */
00138 #if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
00139 
00140 /* 7.18.4.1  Macros for minimum-width integer constants */
00141 
00142 #define INT8_C(val) ((int8_t) + (val))
00143 #define UINT8_C(val) ((uint8_t) + (val##U))
00144 #define INT16_C(val) ((int16_t) + (val))
00145 #define UINT16_C(val) ((uint16_t) + (val##U))
00146 
00147 #define INT32_C(val) (val##L)
00148 #define UINT32_C(val) (val##UL)
00149 #define INT64_C(val) (val##LL)
00150 #define UINT64_C(val) (val##ULL)
00151 
00152 /* 7.18.4.2  Macros for greatest-width integer constants */
00153 #define INTMAX_C(val)  (INT64_C(val))
00154 #define UINTMAX_C(val) (UINT64_C(val))
00155 
00156 #endif  /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
00157 
00158 #endif
00159 

Generated on Mon Dec 1 11:12:20 2008 for AVR498 : Atmel BLDC control on ATAVRMC301 with ATtiny861 by  doxygen 1.5.4