drivers/ecos_lpc2138_sja1000/applicfg.h
author etisserant
Tue, 20 Jun 2006 17:41:13 +0200
changeset 36 ff3ba4a90548
parent 0 4472ee7c6c3e
permissions -rw-r--r--
Added bauderate/disable option to TestMasterSlave Master and Slave nodes.
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     1
/*
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     2
This file is part of CanFestival, a library implementing CanOpen Stack. 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     3
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     4
Copyright (C): Edouard TISSERANT and Francis DUPIN
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     5
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     6
See COPYING file for copyrights details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     7
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     8
This library is free software; you can redistribute it and/or
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     9
modify it under the terms of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    10
License as published by the Free Software Foundation; either
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    11
version 2.1 of the License, or (at your option) any later version.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    12
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    13
This library is distributed in the hope that it will be useful,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    14
but WITHOUT ANY WARRANTY; without even the implied warranty of
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    16
Lesser General Public License for more details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    17
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    18
You should have received a copy of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    19
License along with this library; if not, write to the Free Software
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    21
*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    22
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    23
#ifndef __APPLICFG_ECOS__
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    24
#define __APPLICFG_ECOS__
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    25
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    26
#include <string.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    27
#include <stdio.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    28
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    29
// Define the architecture : little_endian or big_endian
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    30
// -----------------------------------------------------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    31
// Test :
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    32
// UNS32 v = 0x1234ABCD;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    33
// char *data = &v;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    34
//
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    35
// Result for a little_endian architecture :
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    36
// data[0] = 0xCD;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    37
// data[1] = 0xAB;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    38
// data[2] = 0x34;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    39
// data[3] = 0x12;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    40
//
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    41
// Result for a big_endian architecture :
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    42
// data[0] = 0x12;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    43
// data[1] = 0x34;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    44
// data[2] = 0xAB;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    45
// data[3] = 0xCD;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    46
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    47
// Integers
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    48
#define INTEGER8 char
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    49
#define INTEGER16 short
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    50
#define INTEGER24
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    51
#define INTEGER32 long
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    52
#define INTEGER40
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    53
#define INTEGER48
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    54
#define INTEGER56
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    55
#define INTEGER64
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    56
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    57
// Unsigned integers
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    58
#define UNS8   unsigned char
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    59
#define UNS16  unsigned short
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    60
#define UNS32  unsigned long
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    61
#define UNS24
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    62
#define UNS40
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    63
#define UNS48
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    64
#define UNS56
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    65
#define UNS64 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    66
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    67
// Time unit : us
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    68
// Time resolution : 32bits
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    69
#define TIMEVAL unsigned int 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    70
#define TIMEVAL_MAX 0xffff
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    71
#define MS_TO_TIMEVAL(ms) ms*1000
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    72
#define US_TO_TIMEVAL(us) us
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    73
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    74
#define HANDLE	int
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    75
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    76
#if !defined(CAN_HANDLE)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    77
#define CAN_HANDLE  void*
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    78
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    79
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    80
// Reals
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    81
#define REAL32	float
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    82
#define REAL64 double
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    83
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    84
/// Definition of error and warning macros
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    85
// --------------------------------------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    86
#if defined DEBUG_ERR_CONSOLE_ON || defined DEBUG_WAR_CONSOLE_ON
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    87
#include <stdio.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    88
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    89
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    90
/// Definition of MSG_ERR
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    91
// ---------------------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    92
#ifdef DEBUG_ERR_CONSOLE_ON
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    93
#    define MSG_ERR(num, str, val)            \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    94
          printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    95
#else
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    96
#    define MSG_ERR(num, str, val)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    97
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    98
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    99
/// Definition of MSG_WAR
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   100
// ---------------------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   101
#ifdef DEBUG_WAR_CONSOLE_ON
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   102
#    define MSG_WAR(num, str, val)          \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   103
          printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   104
#else
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   105
#    define MSG_WAR(num, str, val)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   106
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   107
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   108
#endif