SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
CanBusAddresses.def
Go to the documentation of this file.
1
12
#ifndef __ECU_CANBUS_ADDRESSES_DEF__
13
// @cond
14
#define __ECU_CANBUS_ADDRESSES_DEF__
15
16
#include "
PPhelp.h
"
17
18
// Address offsets
19
#define ADD_MC0_OFFSET -0x00A0
20
#define ADD_MC1_OFFSET 0x0000
21
#define ADD_BMS_OFFSET 0x0000
22
23
// Define addresses values here
24
#define ADD_BMS_DATA (0x06B0 + ADD_BMS_OFFSET)
25
#define ADD_BMS_BATT_TEMP (0x06B1 + ADD_BMS_OFFSET)
26
#define ADD_BMS_CURR_LIMIT (0x0202 + ADD_BMS_OFFSET)
27
// NOTE: RMS Docs state a default 0x0A0 Offset
28
#define ADD_MC0_TEMP1 (0x00A0 + ADD_MC0_OFFSET)
// Temperatures #1
29
#define ADD_MC1_TEMP1 (0x00A0 + ADD_MC1_OFFSET)
30
#define ADD_MC0_TEMP2 (0x00A1 + ADD_MC0_OFFSET)
// Temperatures #2
31
#define ADD_MC1_TEMP2 (0x00A1 + ADD_MC1_OFFSET)
32
#define ADD_MC0_TEMP3 (0x00A2 + ADD_MC0_OFFSET)
// Temperatures #3
33
#define ADD_MC1_TEMP3 (0x00A2 + ADD_MC1_OFFSET)
34
#define ADD_MC0_RPM (0x00A5 + ADD_MC0_OFFSET)
// Motor Position Information
35
#define ADD_MC1_RPM (0x00A5 + ADD_MC1_OFFSET)
36
#define ADD_MC0_CURR (0x00A6 + ADD_MC0_OFFSET)
// Current Information
37
#define ADD_MC1_CURR (0x00A6 + ADD_MC1_OFFSET)
38
#define ADD_MC0_VOLT (0x00A7 + ADD_MC0_OFFSET)
// Voltage Information
39
#define ADD_MC1_VOLT (0x00A7 + ADD_MC1_OFFSET)
40
#define ADD_MC0_FAULTS (0x00AB + ADD_MC0_OFFSET)
// Fault Codes
41
#define ADD_MC1_FAULTS (0x00AB + ADD_MC1_OFFSET)
42
#define ADD_MC0_CTRL (0x00C0 + ADD_MC0_OFFSET)
// For sending commands
43
#define ADD_MC1_CTRL (0x00C0 + ADD_MC1_OFFSET)
44
#define ADD_MC0_CLEAR (0x00C1 + ADD_MC0_OFFSET)
// For clearing faults
45
#define ADD_MC1_CLEAR (0x00C1 + ADD_MC1_OFFSET)
46
47
#define CANPIN 3
48
49
// canPin addresses
50
#define ADD_CANPIN_ANALOG0 0x0110
51
#define ADD_CANPIN_ANALOG1 0x0120
52
#define ADD_CANPIN_ANALOG2 0x0130
53
#define ADD_CANPIN_ANALOG3 0x0140
54
#define ADD_CANPIN_ANALOG4 0x0150
55
#define ADD_CANPIN_DIGITAL0 0x0100
56
#define ADD_CANPIN_DIGITAL1 0x0200
57
// Logging address
58
#define ADD_AUX_LOGGING 0x0123
59
// Ping address
60
#define ADD_HEART 0x0321
61
// echo address
62
#define ADD_ECHO_DATA 0x0231
63
#define ADD_ECHO_DELAY 0x0232
64
// @endcond
65
81
#define CAN_ADDRESS \
82
X(ADD_BMS_DATA, INPUT) \
83
X(ADD_BMS_BATT_TEMP, INPUT) \
84
X(ADD_BMS_CURR_LIMIT, INPUT) \
85
X(ADD_MC0_VOLT, INPUT) \
86
X(ADD_MC1_VOLT, INPUT) \
87
X(ADD_MC0_TEMP1, INPUT) \
88
X(ADD_MC1_TEMP1, INPUT) \
89
X(ADD_MC0_TEMP2, INPUT) \
90
X(ADD_MC1_TEMP2, INPUT) \
91
X(ADD_MC0_TEMP3, INPUT) \
92
X(ADD_MC1_TEMP3, INPUT) \
93
X(ADD_MC0_RPM, INPUT) \
94
X(ADD_MC1_RPM, INPUT) \
95
X(ADD_MC0_CURR, INPUT) \
96
X(ADD_MC1_CURR, INPUT) \
97
X(ADD_MC0_CTRL, OUTPUT) \
98
X(ADD_MC1_CTRL, OUTPUT) \
99
X(ADD_MC0_CLEAR, OUTPUT) \
100
X(ADD_MC1_CLEAR, OUTPUT) \
101
X(ADD_MC0_FAULTS, INPUT) \
102
X(ADD_MC1_FAULTS, INPUT) \
103
X(ADD_CANPIN_ANALOG0, CANPIN) \
104
X(ADD_CANPIN_ANALOG1, CANPIN) \
105
X(ADD_CANPIN_ANALOG2, CANPIN) \
106
X(ADD_CANPIN_ANALOG3, CANPIN) \
107
X(ADD_CANPIN_ANALOG4, CANPIN) \
108
X(ADD_CANPIN_DIGITAL0, CANPIN) \
109
X(ADD_CANPIN_DIGITAL1, CANPIN) \
110
X(ADD_AUX_LOGGING, CANPIN) \
111
X(ADD_HEART, CANPIN) \
112
X(ADD_ECHO_DATA, CANPIN) \
113
X(ADD_ECHO_DELAY, CANPIN)
114
115
#endif
// __ECU_CANBUS_ADDRESSES_DEF__
PPHelp.h
Compilation of various helpful preprocessor macros.
libraries
Canbus
CanBusAddresses.def
Generated by
1.9.8