Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# avrlibtypes.h

Go to the documentation of this file.

    00001 /*! \file avrlibtypes.h \brief AVRlib global types and typedefines. */
    00002 //*****************************************************************************
    00003 //
    00004 // File Name    : 'avrlibtypes.h'
    00005 // Title        : AVRlib global types and typedefines include file
    00006 // Author       : Pascal Stang
    00007 // Created      : 7/12/2001
    00008 // Revised      : 9/30/2002
    00009 // Version      : 1.0
    00010 // Target MCU   : Atmel AVR series
    00011 // Editor Tabs  : 4
    00012 //
    00013 //  Description : Type-defines required and used by AVRlib.  Most types are also
    00014 //                      generally useful.
    00015 //
    00016 // This code is distributed under the GNU Public License
    00017 //      which can be found at http://www.gnu.org/licenses/gpl.txt
    00018 //
    00019 //*****************************************************************************
    00020
    00021
    00022 #ifndef AVRLIBTYPES_H
    00023 #define AVRLIBTYPES_H
    00024
    00025 #ifndef WIN32
    00026     // true/false defines
    00027     #define FALSE   0
    00028     #define TRUE    -1
    00029 #endif
    00030
    00031 // datatype definitions macros
    00032 typedef unsigned char  u08;
    00033 typedef   signed char  s08;
    00034 typedef unsigned short u16;
    00035 typedef   signed short s16;
    00036 typedef unsigned long  u32;
    00037 typedef   signed long  s32;
    00038 typedef unsigned long long u64;
    00039 typedef   signed long long s64;
    00040
    00041 /* use inttypes.h instead
    00042 // C99 standard integer type definitions
    00043 typedef unsigned char   uint8_t;
    00044 typedef   signed char   int8_t;
    00045 typedef unsigned short  uint16_t;
    00046 typedef   signed short  int16_t;
    00047 typedef unsigned long   uint32_t;
    00048 typedef   signed long   int32_t;
    00049 typedef unsigned long   uint64_t;
    00050 typedef   signed long   int64_t;
    00051 */
    00052 // maximum value that can be held
    00053 // by unsigned data types (8,16,32bits)
    00054 #define MAX_U08 255
    00055 #define MAX_U16 65535
    00056 #define MAX_U32 4294967295
    00057
    00058 // maximum values that can be held
    00059 // by signed data types (8,16,32bits)
    00060 #define MIN_S08 -128
    00061 #define MAX_S08 127
    00062 #define MIN_S16 -32768
    00063 #define MAX_S16 32767
    00064 #define MIN_S32 -2147483648
    00065 #define MAX_S32 2147483647
    00066
    00067 #ifndef WIN32
    00068     // more type redefinitions
    00069     typedef unsigned char   BOOL;
    00070     typedef unsigned char   BYTE;
    00071     typedef unsigned int    WORD;
    00072     typedef unsigned long   DWORD;
    00073
    00074     typedef unsigned char   UCHAR;
    00075     typedef unsigned int    UINT;
    00076     typedef unsigned short  USHORT;
    00077     typedef unsigned long   ULONG;
    00078
    00079     typedef char            CHAR;
    00080     typedef int             INT;
    00081     typedef long            LONG;
    00082 #endif
    00083
    00084 #endif