| Line No. | Rev | Author | Line |
|---|---|---|---|
| 1 | 6 | kaklik | /*! \file avrlibtypes.h \brief AVRlib global types and typedefines. */ |
| 2 | //***************************************************************************** |
||
| 3 | // |
||
| 4 | // File Name : 'avrlibtypes.h' |
||
| 5 | // Title : AVRlib global types and typedefines include file |
||
| 6 | // Author : Pascal Stang |
||
| 7 | // Created : 7/12/2001 |
||
| 8 | // Revised : 9/30/2002 |
||
| 9 | // Version : 1.0 |
||
| 10 | // Target MCU : Atmel AVR series |
||
| 11 | // Editor Tabs : 4 |
||
| 12 | // |
||
| 13 | // Description : Type-defines required and used by AVRlib. Most types are also |
||
| 14 | // generally useful. |
||
| 15 | // |
||
| 16 | // This code is distributed under the GNU Public License |
||
| 17 | // which can be found at http://www.gnu.org/licenses/gpl.txt |
||
| 18 | // |
||
| 19 | //***************************************************************************** |
||
| 20 | |||
| 21 | |||
| 22 | #ifndef AVRLIBTYPES_H |
||
| 23 | #define AVRLIBTYPES_H |
||
| 24 | |||
| 25 | #ifndef WIN32 |
||
| 26 | // true/false defines |
||
| 27 | #define FALSE 0 |
||
| 28 | #define TRUE -1 |
||
| 29 | #endif |
||
| 30 | |||
| 31 | // datatype definitions macros |
||
| 32 | typedef unsigned char u08; |
||
| 33 | typedef signed char s08; |
||
| 34 | typedef unsigned short u16; |
||
| 35 | typedef signed short s16; |
||
| 36 | typedef unsigned long u32; |
||
| 37 | typedef signed long s32; |
||
| 38 | typedef unsigned long long u64; |
||
| 39 | typedef signed long long s64; |
||
| 40 | |||
| 41 | /* use inttypes.h instead |
||
| 42 | // C99 standard integer type definitions |
||
| 43 | typedef unsigned char uint8_t; |
||
| 44 | typedef signed char int8_t; |
||
| 45 | typedef unsigned short uint16_t; |
||
| 46 | typedef signed short int16_t; |
||
| 47 | typedef unsigned long uint32_t; |
||
| 48 | typedef signed long int32_t; |
||
| 49 | typedef unsigned long uint64_t; |
||
| 50 | typedef signed long int64_t; |
||
| 51 | */ |
||
| 52 | // maximum value that can be held |
||
| 53 | // by unsigned data types (8,16,32bits) |
||
| 54 | #define MAX_U08 255 |
||
| 55 | #define MAX_U16 65535 |
||
| 56 | #define MAX_U32 4294967295 |
||
| 57 | |||
| 58 | // maximum values that can be held |
||
| 59 | // by signed data types (8,16,32bits) |
||
| 60 | #define MIN_S08 -128 |
||
| 61 | #define MAX_S08 127 |
||
| 62 | #define MIN_S16 -32768 |
||
| 63 | #define MAX_S16 32767 |
||
| 64 | #define MIN_S32 -2147483648 |
||
| 65 | #define MAX_S32 2147483647 |
||
| 66 | |||
| 67 | #ifndef WIN32 |
||
| 68 | // more type redefinitions |
||
| 69 | typedef unsigned char BOOL; |
||
| 70 | typedef unsigned char BYTE; |
||
| 71 | typedef unsigned int WORD; |
||
| 72 | typedef unsigned long DWORD; |
||
| 73 | |||
| 74 | typedef unsigned char UCHAR; |
||
| 75 | typedef unsigned int UINT; |
||
| 76 | typedef unsigned short USHORT; |
||
| 77 | typedef unsigned long ULONG; |
||
| 78 | |||
| 79 | typedef char CHAR; |
||
| 80 | typedef int INT; |
||
| 81 | typedef long LONG; |
||
| 82 | #endif |
||
| 83 | |||
| 84 | #endif |
Powered by WebSVN v2.8.3