2 This file is part of CanFestival, a library implementing CanOpen Stack.
4 Copyright (C): Edouard TISSERANT and Francis DUPIN
5 AT91 Port: Peter CHRISTEN
7 See COPYING file for copyrights details.
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef __APPLICFG_AVR__
25 #define __APPLICFG_AVR__
31 /// Convert an integer to a string in hexadecimal format
32 /// If you do not wants to use a lastCar, put lastCar = '\0' (end of string)
33 /// ex : value = 0XABCDEF and lastCar = '\n'
42 hex_convert (char *buf, unsigned long value, char lastCar);
44 /// Print the string to the serial port sci
45 /// (sci takes the values SCI0 or SCI1)
46 extern void printSCI_str (char sci, const char * str);
48 /// Print the number in hexadecimal to the serial port sci
49 /// (sci takes the values SCI0 or SCI1)
50 extern void printSCI_nbr (char sci, unsigned long nbr, char lastCar);
53 #define INTEGER8 signed char
54 #define INTEGER16 short
55 #define INTEGER24 long
56 #define INTEGER32 long
57 #define INTEGER40 long long
58 #define INTEGER48 long long
59 #define INTEGER56 long long
60 #define INTEGER64 long long
63 #define UNS8 unsigned char
64 #define UNS16 unsigned short
65 #define UNS32 unsigned long
66 #define UNS24 unsigned long
67 #define UNS40 unsigned long long
68 #define UNS48 unsigned long long
69 #define UNS56 unsigned long long
70 #define UNS64 unsigned long long
83 /// Definition of MSG_ERR
84 // ---------------------
85 #ifdef DEBUG_ERR_CONSOLE_ON
86 # define MSG_ERR(num, str, val) \
88 printSCI_nbr(SCI0, num, ' '); \
89 /* large printing on console */ \
90 printSCI_str(SCI0, str); \
91 printSCI_nbr(SCI0, val, '\n');
93 # define MSG_ERR(num, str, val)
96 /// Definition of MSG_WAR
97 // ---------------------
98 #ifdef DEBUG_WAR_CONSOLE_ON
99 # define MSG_WAR(num, str, val) \
101 printSCI_nbr(SCI0, num, ' '); \
102 /* large printing on console */ \
103 printSCI_str(SCI0, str); \
104 printSCI_nbr(SCI0, val, '\n');
106 # define MSG_WAR(num, str, val)
109 typedef void* CAN_HANDLE;
111 typedef void* CAN_PORT;