00001 #ifndef TYPE_H
00002 #define TYPE_H
00003
00004 #include "lpc2xxx.h"
00005
00006 #include "global.h"
00007
00008 #ifndef ROUNDUP
00009 #define ROUNDUP(x, to) ((((x)+(to)-1)/(to))*(to)) // make x+to is multiply of to.
00010 #endif
00011
00012 typedef unsigned long UINT32;
00013 typedef long INT32;
00014 typedef unsigned short UINT16;
00015 typedef short INT16;
00016 typedef unsigned char UINT8;
00017 typedef unsigned long ULONG;
00018 typedef unsigned char UCHAR;
00019 typedef unsigned char boolean;
00020
00021 #ifndef INT8
00022 typedef signed char INT8;
00023 #endif
00024
00025 #ifndef BYTE
00026 #define BYTE UINT8
00027 #endif
00028
00029 #ifndef WORD
00030 #define WORD UINT16
00031 #endif
00032
00033 #ifndef DWORD
00034 #define DWORD UINT32
00035 #endif
00036
00037 #ifndef UINT
00038 #define UINT U32
00039 #endif
00040
00041 #ifndef LPSTR
00042 #define LPSTR (U8 *)
00043 #endif
00044
00045 #ifndef BOOL
00046 #define BOOL UINT8
00047 #endif
00048
00049 #ifndef USHORT
00050 #define USHORT U16
00051 #endif
00052
00053 #ifndef TRUE
00054 #define TRUE 1
00055 #endif
00056
00057 #ifndef FALSE
00058 #define FALSE 0
00059 #endif
00060
00061 #ifndef NULL
00062 #define NULL 0
00063 #endif
00064
00065 #define BIT_SET(n) (1 << n)
00066 #define BIT_CLEAR(n) (~(1 << n))
00067
00068 #endif