can_config.h
Go to the documentation of this file.
1 #ifndef CAN_CONFIG_H
2 #define CAN_CONFIG_H
3 
4 // -----------------------------------------------------------------------------
5 /* Global settings for building the can-lib and application program.
6  *
7  * The following two #defines must be set identically for the can-lib and
8  * your application program. They control the underlying CAN struct. If the
9  * settings disagree, the underlying CAN struct will be broken, with
10  * unpredictable results.
11  * If can.h detects that any of the #defines is not defined, it will set them
12  * to the default values shown here, so it is in your own interest to have a
13  * consistent setting. Ommiting the #defines in both can-lib and application
14  * program will apply the defaults in a consistent way too.
15  *
16  * Select if you want to use 29 bit identifiers.
17  */
18 #define SUPPORT_EXTENDED_CANID 1
19 
20 /* Select if you want to use timestamps.
21  * Timestamps are sourced from a register internal to the AT90CAN.
22  * Selecting them on any other controller will have no effect, they will
23  * be 0 all the time.
24  */
25 #define SUPPORT_TIMESTAMPS 0
26 
27 
28 // -----------------------------------------------------------------------------
29 /* Global settings for building the can-lib.
30  *
31  * Select ONE CAN controller for which you are building the can-lib.
32  */
33 #define SUPPORT_MCP2515 0
34 #define SUPPORT_AT90CAN 1
35 #define SUPPORT_SJA1000 0
36 
37 
38 // -----------------------------------------------------------------------------
39 /* Setting for MCP2515
40  *
41  * Declare which pins you are using for communication.
42  * Remember NOT to use them in your application!
43  * It is a good idea to use bits from the port that carries MOSI, MISO, SCK.
44  */
45 #define MCP2515_CS B, 4
46 #define MCP2515_INT B, 2
47 
48 // -----------------------------------------------------------------------------
49 // Setting for SJA1000
50 
51 #define SJA1000_INT E, 0
52 #define SJA1000_MEMORY_MAPPED 1
53 
54 // memory-mapped interface
55 #define SJA1000_BASE_ADDR 0x8000 // for ATMega162
56 
57 /*
58  // port-interface
59  #define SJA1000_WR D,6
60  #define SJA1000_RD D,7
61 
62  #define SJA1000_ALE E,1
63  #define SJA1000_CS C,0
64  #define SJA1000_DATA A
65  */
66 
67 // -----------------------------------------------------------------------------
68 // Setting for AT90CAN
69 
70 // Number of CAN messages which are buffered in RAM additinally to the MObs
71 #define CAN_RX_BUFFER_SIZE 16
72 #define CAN_TX_BUFFER_SIZE 8
73 
74 // only available if CAN_TX_BUFFER_SIZE > 0
75 #define CAN_FORCE_TX_ORDER 1
76 
77 #endif // CAN_CONFIG_H


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:02