27#ifndef __ECU_PINCONFIG_DEF__
31#define __ECU_PINCONFIG_DEF__
47#define CONF_PINS_CANBUS_UPDATE_INTERVAL_MICRO 50000
52#define CONF_PINS_ANALOG_WRITE_RESOLUTION 12
59#define PINS_INTERNAL_CHARGE_SIGNAL 100
60#define PINS_INTERNAL_START 101
61#define PINS_INTERNAL_BMS_FAULT 102
62#define PINS_INTERNAL_IMD_FAULT 103
63#define PINS_INTERNAL_GEN_FAULT 104
64#define PINS_INTERNAL_STATE 105
65#define PINS_INTERNAL_SYNC 106
66#define PINS_INTERNAL_REVERSE 107
67#define PINS_INTERNAL_TVAGG 108
70#define PINS_BOTH_LED 13
73#define PINS_BACK_SERVO_OFF 0
74#define PINS_BACK_TSV_SIGNAL 3
75#define PINS_BACK_AIR2 4
76#define PINS_BACK_CHARGING_RELAY 5
77#define PINS_BACK_SOUND_DRIVER 6
78#define PINS_BACK_BRAKE_LIGHT 7
79#define PINS_BACK_SERVO1_PWM 8
80#define PINS_BACK_PRECHARGE_RELAY 9
81#define PINS_BACK_AIR1 10
82#define PINS_BACK_FANS_ONOFF 24
83#define PINS_BACK_SHUTDOWN_SIGNAL 25
84#define PINS_BACK_HVD_FAULT 26
85#define PINS_BACK_SERVO2_PWM 30
86#define PINS_BACK_FAN1_PWM 23
87#define PINS_BACK_FAN2_PWM 22
88#define PINS_BACK_FAN3_PWM 21
89#define PINS_BACK_FAN4_PWM 20
90#define PINS_BACK_IMD_FAULT 19
91#define PINS_BACK_BMS_FAULT 18
92#define PINS_BACK_PUMP_DAC 66
95#define PINS_FRONT_BUTTON_INPUT_OFF 2
96#define PINS_FRONT_WHEEL1 21
97#define PINS_FRONT_WHEEL0 20
98#define PINS_FRONT_PEDAL1 A4
99#define PINS_FRONT_PEDAL0 A2
100#define PINS_FRONT_STEER 15
101#define PINS_FRONT_BRAKE 14
102#define PINS_FRONT_IMD_LIGHT 38
103#define PINS_FRONT_BMS_LIGHT 37
104#define PINS_FRONT_START_LIGHT 36
107#if CONF_ECU_POSITION == BACK_ECU
133 X(PINS_BOTH_LED, DIGITAL, OUTPUT, NIL) \
134 X(PINS_BACK_SERVO_OFF, DIGITAL, OUTPUT, 0) \
135 X(PINS_BACK_TSV_SIGNAL, DIGITAL, INPUT, NIL) \
136 X(PINS_BACK_AIR2, ANALOG, OUTPUT, 0) \
137 X(PINS_BACK_CHARGING_RELAY, DIGITAL, OUTPUT, 1) \
138 X(PINS_BACK_SOUND_DRIVER, ANALOG, OUTPUT, 0) \
139 X(PINS_BACK_BRAKE_LIGHT, ANALOG, OUTPUT, 0) \
140 X(PINS_BACK_SERVO1_PWM, ANALOG, OUTPUT, NIL) \
141 X(PINS_BACK_PRECHARGE_RELAY, ANALOG, OUTPUT, 0) \
142 X(PINS_BACK_AIR1, ANALOG, OUTPUT, 0) \
143 X(PINS_BACK_FANS_ONOFF, DIGITAL, OUTPUT, 0) \
144 X(PINS_BACK_SHUTDOWN_SIGNAL, DIGITAL, INPUT, NIL) \
145 X(PINS_BACK_HVD_FAULT, DIGITAL, INPUT, NIL) \
146 X(PINS_BACK_SERVO2_PWM, ANALOG, OUTPUT, NIL) \
147 X(PINS_BACK_FAN1_PWM, ANALOG, OUTPUT, 0) \
148 X(PINS_BACK_FAN2_PWM, ANALOG, OUTPUT, 0) \
149 X(PINS_BACK_FAN3_PWM, ANALOG, OUTPUT, 0) \
150 X(PINS_BACK_FAN4_PWM, ANALOG, OUTPUT, 0) \
151 X(PINS_BACK_IMD_FAULT, DIGITAL, INPUT, NIL) \
152 X(PINS_BACK_BMS_FAULT, DIGITAL, INPUT, NIL) \
153 X(PINS_BACK_PUMP_DAC, ANALOG, OUTPUT, 0)
172#define PINS_CANBUS_ANALOG_IN \
173 X(ADD_CANPIN_ANALOG0, PINS_FRONT_PEDAL0) \
174 X(ADD_CANPIN_ANALOG0, PINS_FRONT_PEDAL1) \
175 X(ADD_CANPIN_ANALOG1, PINS_FRONT_WHEEL1) \
176 X(ADD_CANPIN_ANALOG1, PINS_FRONT_WHEEL0) \
177 X(ADD_CANPIN_ANALOG2, PINS_FRONT_STEER) \
178 X(ADD_CANPIN_ANALOG2, PINS_FRONT_BRAKE) \
179 X(ADD_CANPIN_ANALOG4, PINS_INTERNAL_TVAGG)
184#define PINS_CANBUS_ANALOG_OUT \
185 X(ADD_CANPIN_ANALOG3, PINS_INTERNAL_STATE)
204#define PINS_CANBUS_DIGITAL_IN \
205 X(ADD_CANPIN_DIGITAL1, PINS_INTERNAL_CHARGE_SIGNAL) \
206 X(ADD_CANPIN_DIGITAL1, PINS_INTERNAL_SYNC) \
207 X(ADD_CANPIN_DIGITAL1, PINS_INTERNAL_REVERSE) \
208 X(ADD_CANPIN_DIGITAL1, PINS_FRONT_BUTTON_INPUT_OFF)
213#define PINS_CANBUS_DIGITAL_OUT \
214 X(ADD_CANPIN_DIGITAL0, PINS_INTERNAL_START) \
215 X(ADD_CANPIN_DIGITAL0, PINS_INTERNAL_BMS_FAULT) \
216 X(ADD_CANPIN_DIGITAL0, PINS_INTERNAL_IMD_FAULT) \
217 X(ADD_CANPIN_DIGITAL0, PINS_INTERNAL_GEN_FAULT)
221 X(PINS_BOTH_LED, DIGITAL, OUTPUT, NIL) \
222 X(PINS_FRONT_BUTTON_INPUT_OFF, DIGITAL, INPUT, NIL) \
223 X(PINS_FRONT_WHEEL1, ANALOG, INPUT, NIL) \
224 X(PINS_FRONT_WHEEL0, ANALOG, INPUT, NIL) \
225 X(PINS_FRONT_PEDAL1, ANALOG, INPUT, NIL) \
226 X(PINS_FRONT_PEDAL0, ANALOG, INPUT, NIL) \
227 X(PINS_FRONT_STEER, ANALOG, INPUT, NIL) \
228 X(PINS_FRONT_BRAKE, ANALOG, INPUT, NIL) \
229 X(PINS_FRONT_IMD_LIGHT, DIGITAL, OUTPUT, 0) \
230 X(PINS_FRONT_BMS_LIGHT, DIGITAL, OUTPUT, 0) \
231 X(PINS_FRONT_START_LIGHT, DIGITAL, OUTPUT, 0)
233#define PINS_CANBUS_ANALOG_IN \
234 X(ADD_CANPIN_ANALOG3, PINS_INTERNAL_STATE)
236#define PINS_CANBUS_ANALOG_OUT \
237 X(ADD_CANPIN_ANALOG0, PINS_FRONT_PEDAL0) \
238 X(ADD_CANPIN_ANALOG0, PINS_FRONT_PEDAL1) \
239 X(ADD_CANPIN_ANALOG1, PINS_FRONT_WHEEL1) \
240 X(ADD_CANPIN_ANALOG1, PINS_FRONT_WHEEL0) \
241 X(ADD_CANPIN_ANALOG2, PINS_FRONT_STEER) \
242 X(ADD_CANPIN_ANALOG2, PINS_FRONT_BRAKE) \
243 X(ADD_CANPIN_ANALOG4, PINS_INTERNAL_TVAGG)
245#define PINS_CANBUS_DIGITAL_IN \
246 X(ADD_CANPIN_DIGITAL0, PINS_INTERNAL_START) \
247 X(ADD_CANPIN_DIGITAL0, PINS_INTERNAL_BMS_FAULT) \
248 X(ADD_CANPIN_DIGITAL0, PINS_INTERNAL_IMD_FAULT) \
249 X(ADD_CANPIN_DIGITAL0, PINS_INTERNAL_GEN_FAULT)
251#define PINS_CANBUS_DIGITAL_OUT \
252 X(ADD_CANPIN_DIGITAL1, PINS_INTERNAL_CHARGE_SIGNAL) \
253 X(ADD_CANPIN_DIGITAL1, PINS_INTERNAL_SYNC) \
254 X(ADD_CANPIN_DIGITAL1, PINS_INTERNAL_REVERSE) \
255 X(ADD_CANPIN_DIGITAL1, PINS_FRONT_BUTTON_INPUT_OFF)
Configure global build properties.
Compilation of various helpful preprocessor macros.