libHartwer - Documentation

bcs_global.h

00001 /*
00002 * Copyright (c) 2008-2010 Elefant Racing Bayreuth. All rights reserved.
00003 *
00004 * @ERB_CLOSED_LICENSE_HEADER_START@
00005 *
00006 * This file is part of the custom developed 
00007 * board computer system of Elefant Racing Bayreuth
00008 * or part of its connected software.
00009 *
00010 * ANY SOURCECODE BEARING THIS HEADER SHALL NOT BE RELEASED TO THE
00011 * PUBLIC OR DISTRIBUTED IN ANY WAY WITHOUT PERMISSION OF 
00012 * ELEFANT RACING BAYREUTH.
00013 *
00014 * In case of known violation of this rule or for requesting
00015 * a legal permission, please contact our team.
00016 *
00017 * Adresses can be found at
00018 *
00019 *      http://www.elefantracing.de
00020 *
00021 * @ERB_CLOSED_LICENSE_HEADER_END@
00022 */
00023 
00036 #ifndef GLOBAL_H_
00037 #define GLOBAL_H_
00038 
00043 typedef signed char Int8;
00044 
00049 typedef unsigned char UInt8;
00050 
00055 typedef signed short int Int16;
00056 
00061 typedef unsigned short int UInt16;
00062 
00067 typedef signed long int Int32;
00068 
00073 typedef unsigned long int UInt32;
00074 
00075 #ifndef __cplusplus
00076 
00080 typedef UInt8 bool;
00081 
00082 #ifndef true
00083 #define true TRUE
00084 #define false FALSE
00085 #endif
00086 
00087 #endif
00088 
00114 #ifdef BIGENDIAN
00115 #define MAKE_INT16(a,b) (Int16)( (a<<8) | (UInt8)(b) )
00116 #define MAKE_UINT16(a,b) (UInt16)( (a<<8) | (UInt8)(b) )
00117 
00118 #define LOW_BYTE(w) (UInt8)(w >> 8)
00119 #define HIGH_BYTE(w) (UInt8)(w & 0xFF)
00120 #else
00121 // little endian
00122 #define MAKE_INT16(a,b) (Int16)( (b<<8) | (UInt8)(a) )
00123 #define MAKE_UINT16(a,b) (UInt16) ( (b<<8) | (UInt8)(a) )
00124 
00125 #define LOW_BYTE(w) (UInt8)(w & 0xFF)
00126 #define HIGH_BYTE(w) (UInt8)(w >> 8)
00127 #endif
00128 
00129 #ifndef INT8_MAX
00130 #define INT8_MAX     (Int8) (0x7F)
00131 #endif
00132 #ifndef INT8_MIN
00133 #define INT8_MIN     (Int8) (0x80)
00134 #endif
00135 #ifndef INT16_MAX
00136 #define INT16_MAX    (Int16) (0x7FFF)
00137 #endif
00138 #ifndef INT16_MIN
00139 #define INT16_MIN    (Int16) (0x8000)
00140 #endif
00141 #ifndef INT32_MAX
00142 #define INT32_MAX    (Int32) (0x7FFFFFFF)
00143 #endif
00144 #ifndef INT32_MIN
00145 #define       INT32_MIN     (Int32) (0x80000000)
00146 #endif
00147 
00148 #ifndef UINT8_MAX
00149 #define UINT8_MAX    (UInt8) (0xFF)
00150 #endif
00151 #ifndef UINT8_MIN
00152 #define UINT8_MIN    (UInt8) (0)
00153 #endif
00154 #ifndef UINT16_MAX
00155 #define UINT16_MAX   (UInt16) (0xFFFF)
00156 #endif
00157 #ifndef UINT16_MIN
00158 #define UINT16_MIN   (UInt16) (0)
00159 #endif
00160 #ifndef UINT32_MAX
00161 #define UINT32_MAX   (UInt32) (0xFFFFFFFF)
00162 #endif
00163 #ifndef UINT32_MIN
00164 #define UINT32_MIN   (UInt32) (0)
00165 #endif
00166 
00167 #ifndef FALSE
00168 #define FALSE 0
00169 #endif
00170 #ifndef TRUE
00171 #define TRUE 1
00172 #endif
00173 #ifndef NULL
00174 #define NULL 0
00175 #endif
00176 
00179 #endif /* GLOBAL_H_ */

Generated on Fri Feb 11 2011 18:25:46 for libHartwer by Doxygen 1.7.3
Content © 2009-2011 Elefant Racing Bayreuth & MLBA (About) – Design © 2010 Emzeat. All Rights reserved.