applicfg.h

Go to the documentation of this file.
00001 /*
00002 This file is part of CanFestival, a library implementing CanOpen Stack. 
00003 
00004 Copyright (C): Edouard TISSERANT and Francis DUPIN
00005 
00006 See COPYING file for copyrights details.
00007 
00008 This library is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU Lesser General Public
00010 License as published by the Free Software Foundation; either
00011 version 2.1 of the License, or (at your option) any later version.
00012 
00013 This library is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 Lesser General Public License for more details.
00017 
00018 You should have received a copy of the GNU Lesser General Public
00019 License along with this library; if not, write to the Free Software
00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 */
00022 
00023 #ifndef __APPLICFG_LINUX__
00024 #define __APPLICFG_LINUX__
00025 
00026 #include <string.h>
00027 #include <stdio.h>
00028 #include <sys/types.h>
00029 
00030 /*  Define the architecture : little_endian or big_endian
00031  -----------------------------------------------------
00032  Test :
00033  UNS32 v = 0x1234ABCD;
00034  char *data = &v;
00035 
00036  Result for a little_endian architecture :
00037  data[0] = 0xCD;
00038  data[1] = 0xAB;
00039  data[2] = 0x34;
00040  data[3] = 0x12;
00041 
00042  Result for a big_endian architecture :
00043  data[0] = 0x12;
00044  data[1] = 0x34;
00045  data[2] = 0xAB;
00046  data[3] = 0xCD;
00047  */
00048 
00049 /* Integers */
00050 #define INTEGER8 int8_t
00051 #define INTEGER16 int16_t
00052 #define INTEGER24 int32_t
00053 #define INTEGER32 int32_t
00054 #define INTEGER40 int64_t
00055 #define INTEGER48 int64_t
00056 #define INTEGER56 int64_t
00057 #define INTEGER64 int64_t
00058 
00059 /* Unsigned integers */
00060 #define UNS8   u_int8_t
00061 #define UNS16  u_int16_t
00062 #define UNS32  u_int32_t
00063 #define UNS24  u_int32_t
00064 #define UNS40  u_int64_t
00065 #define UNS48  u_int64_t
00066 #define UNS56  u_int64_t
00067 #define UNS64  u_int64_t
00068 
00069 /* Reals */
00070 #define REAL32  float
00071 #define REAL64 double
00072 
00073 /* Definition of error and warning macros */
00074 /* -------------------------------------- */
00075 #if defined DEBUG_ERR_CONSOLE_ON || defined DEBUG_WAR_CONSOLE_ON
00076 #include <stdio.h>
00077 #endif
00078 
00079 /* Definition of MSG_ERR */
00080 /* --------------------- */
00081 #ifdef DEBUG_ERR_CONSOLE_ON
00082 #    define MSG_ERR(num, str, val)            \
00083           printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val);
00084 #else
00085 #    define MSG_ERR(num, str, val)
00086 #endif
00087 
00088 /* Definition of MSG_WAR */
00089 /* --------------------- */
00090 #ifdef DEBUG_WAR_CONSOLE_ON
00091 #    define MSG_WAR(num, str, val)          \
00092           printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val);
00093 #else
00094 #    define MSG_WAR(num, str, val)
00095 #endif
00096 
00097 typedef void* CAN_HANDLE;
00098 
00099 typedef void* CAN_PORT;
00100 
00101 #endif

Generated on Mon Jul 2 19:10:16 2007 for CanFestival by  doxygen 1.5.1