nico@215: nico@215: nico@215: CanFestival: include/unix/applicfg.h Source File nico@215: nico@215: nico@215: nico@215: nico@215:
nico@215:
nico@215:
nico@215:
nico@215: nico@215:

applicfg.h

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

Generated on Fri Jun 8 08:51:39 2007 for CanFestival by  nico@215: nico@215: doxygen 1.5.1
nico@215: nico@215: