521
|
1 |
/*
|
|
2 |
This file is part of CanFestival, a library implementing CanOpen Stack.
|
|
3 |
|
|
4 |
Copyright (C): Edouard TISSERANT and Francis DUPIN
|
|
5 |
AT91 Port: Peter CHRISTEN
|
|
6 |
|
|
7 |
See COPYING file for copyrights details.
|
|
8 |
|
|
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.
|
|
13 |
|
|
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.
|
|
18 |
|
|
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
|
|
22 |
*/
|
|
23 |
|
|
24 |
#ifndef _CONFIG_H_
|
|
25 |
#define _CONFIG_H_
|
|
26 |
|
|
27 |
//#include "compiler.h"
|
|
28 |
|
|
29 |
#ifdef __IAR_SYSTEMS_ICC__
|
|
30 |
#include <intrinsics.h>
|
|
31 |
#include <atmel/ioat91sam7x256.h>
|
|
32 |
#define __inline inline
|
|
33 |
#include "atmel/lib_AT91SAM7X256.h"
|
|
34 |
//#include "iar.h"
|
|
35 |
#else // GCC
|
|
36 |
#include <avr\io.h>
|
|
37 |
#include <avr\interrupt.h>
|
|
38 |
#include <inttypes.h>
|
|
39 |
#include <avr\sleep.h>
|
|
40 |
#include <avr\wdt.h>
|
|
41 |
#endif // GCC
|
|
42 |
|
|
43 |
#define WD_SLEEP
|
|
44 |
|
|
45 |
#define FALSE 0
|
|
46 |
#define TRUE 1
|
|
47 |
|
|
48 |
// Needed defines by Atmel lib
|
|
49 |
#define AT91C_MASTER_CLOCK 48000000UL // Master Clock
|
|
50 |
#define CAN_BAUDRATE 125
|
|
51 |
|
|
52 |
// Needed defines by Canfestival lib
|
|
53 |
#define MAX_CAN_BUS_ID 1
|
|
54 |
#define SDO_MAX_LENGTH_TRANSFERT 32
|
|
55 |
#define SDO_MAX_SIMULTANEOUS_TRANSFERTS 1
|
|
56 |
#define NMT_MAX_NODE_ID 128
|
|
57 |
#define SDO_TIMEOUT_MS 3000U
|
|
58 |
#define MAX_NB_TIMER 8
|
|
59 |
|
|
60 |
// CANOPEN_BIG_ENDIAN is not defined
|
|
61 |
#define CANOPEN_LITTLE_ENDIAN 1
|
|
62 |
|
|
63 |
#define US_TO_TIMEVAL_FACTOR 8
|
|
64 |
|
|
65 |
#define REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES(repeat)\
|
|
66 |
repeat
|
|
67 |
#define REPEAT_NMT_MAX_NODE_ID_TIMES(repeat)\
|
|
68 |
repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat
|
|
69 |
|
|
70 |
#define EMCY_MAX_ERRORS 8
|
|
71 |
#define REPEAT_EMCY_MAX_ERRORS_TIMES(repeat)\
|
|
72 |
repeat repeat repeat repeat repeat repeat repeat repeat
|
|
73 |
|
|
74 |
|
|
75 |
#endif /* _CONFIG_H_ */
|