Open FFBoard
Open source force feedback firmware
eeprom_addresses.c
Go to the documentation of this file.
1/*
2 * eeprom_addresses.c
3 *
4 * Created on: 24.01.2020
5 * Author: Yannick
6 *
7 * /!\ Generated from the file memory_map.csv
8 / ! \ DO NOT EDIT THIS DIRECTLY !!!
9 */
10
11#include "eeprom_addresses.h"
12
13/*
14Add all used addresses to the VirtAddVarTab[] array. This is important for the eeprom emulation to correctly transfer between pages.
15This ensures that addresses that were once used are not copied again in a page transfer if they are not in this array.
16*/
17
18const uint16_t VirtAddVarTab[NB_OF_VAR] =
19{
20// System variables
21 ADR_HW_VERSION,
22 ADR_SW_VERSION,
23 ADR_FLASH_VERSION,
24 ADR_CURRENT_CONFIG,
25// Ports
26 ADR_CANCONF1,
27 ADR_I2CCONF1,
28// FFBWheel
29 ADR_FFBWHEEL_BUTTONCONF,
30 ADR_FFBWHEEL_ANALOGCONF,
31 ADR_FFBWHEEL_CONF1,
32// CAN remote
33 ADR_CANREMOTE_CONF1,
34 ADR_CANREMOTE_CONF2,
35// Button Sources:
36 ADR_SPI_BTN_1_CONF,
37 ADR_SHIFTERANALOG_CONF,
38 ADR_LOCAL_BTN_CONF, // Pin mask
39 ADR_LOCAL_BTN_CONF_2, // Misc settings
40 ADR_SPI_BTN_2_CONF,
41 ADR_SPI_BTN_1_CONF_2,
42 ADR_SPI_BTN_2_CONF_2,
43 ADR_LOCAL_BTN_CONF_3, // Pulse mask
44// Local encoder
45 ADR_ENCLOCAL_CPR,
46 ADR_ENCLOCAL_OFS,
47// PWM
48 ADR_PWM_MODE,
49// Local analog source
50 ADR_LOCALANALOG_MASK,
51// Shifter Analog
52 ADR_SHIFTERANALOG_X_12,
53 ADR_SHIFTERANALOG_X_56,
54 ADR_SHIFTERANALOG_Y_135,
55 ADR_SHIFTERANALOG_Y_246,
56 ADR_SHIFTERANALOG_CONF_2,
57 ADR_SHIFTERANALOG_CONF_3,
58// PCF buttons
59 ADR_PCFBTN_CONF1,
60// CAN port
61 ADR_CANBTN_CONF1,
62 ADR_CANBTN_CONF2, // CAN ID
63// CAN analog
64 ADR_CANANALOG_CONF1,
65// FFB Engine flash area
66 ADR_FFB_CF_FILTER, // Constant Force Lowpass
67 ADR_FFB_FR_FILTER, // Friction Lowpass
68 ADR_FFB_DA_FILTER, // Damper Lowpass
69 ADR_FFB_IN_FILTER, // Inertia Lowpass
70 ADR_FFB_EFFECTS1, // 0-7 inertia, 8-15 friction
71 ADR_FFB_EFFECTS2, // 0-7 spring, 8-15 damper
72 ADR_FFB_EFFECTS3, // 0-7 friction ramp up zone, 8-9 filterProfile
73// Button Sources:
74 ADR_ADS111X_CONF1,
75// How many axis configured 1-3
76 ADR_AXIS_COUNT,
77// AXIS1
78 ADR_AXIS1_CONFIG, // 0-2 ENC, 3-5 DRV
79 ADR_AXIS1_POWER,
80 ADR_AXIS1_DEGREES,
81 ADR_AXIS1_MAX_SPEED, // Store the max speed
82 ADR_AXIS1_MAX_ACCEL, // Store the max accel
83 ADR_AXIS1_ENDSTOP, // 0-7 endstop margin, 8-15 endstop stiffness
84 ADR_AXIS1_EFFECTS1, // 0-7 idlespring, 8-15 damper
85 ADR_AXIS1_SPEEDACCEL_FILTER, // Speed/Accel filter Lowpass profile
86 ADR_AXIS1_ENC_RATIO, // Accel filter Lowpass
87 ADR_AXIS1_EFFECTS2, // 0-7 Friction, 8-15 Inertia
88 ADR_AXIS1_POSTPROCESS1, // 0-7 expo curve
89// TMC1
90 ADR_TMC1_MOTCONF, // 0-2: MotType 3-5: PhiE source 6-15: Poles
91 ADR_TMC1_CPR,
92 ADR_TMC1_ENCA, // Misc
93 ADR_TMC1_ADC_I0_OFS,
94 ADR_TMC1_ADC_I1_OFS,
95 ADR_TMC1_ENC_OFFSET,
96 ADR_TMC1_OFFSETFLUX,
97 ADR_TMC1_TORQUE_P,
98 ADR_TMC1_TORQUE_I,
99 ADR_TMC1_FLUX_P,
100 ADR_TMC1_FLUX_I,
101 ADR_TMC1_PHIE_OFS,
102 ADR_TMC1_TRQ_FILT,
103// AXIS2
104 ADR_AXIS2_CONFIG, // 0-2 ENC, 3-5 DRV
105 ADR_AXIS2_POWER,
106 ADR_AXIS2_DEGREES,
107 ADR_AXIS2_MAX_SPEED, // Store the max speed
108 ADR_AXIS2_MAX_ACCEL, // Store the max accel
109 ADR_AXIS2_ENDSTOP, // 0-7 endstop margin, 8-15 endstop stiffness
110 ADR_AXIS2_EFFECTS1, // 0-7 idlespring, 8-15 damper
111 ADR_AXIS2_SPEEDACCEL_FILTER, // Speed/Accel filter Lowpass profile
112 ADR_AXIS2_ENC_RATIO, // Store the encoder ratio for an axis
113 ADR_AXIS2_EFFECTS2, // 0-7 Friction, 8-15 Inertia
114 ADR_AXIS2_POSTPROCESS1, // 0-7 expo curve
115// TMC2
116 ADR_TMC2_MOTCONF, // 0-2: MotType 3-5: PhiE source 6-15: Poles
117 ADR_TMC2_CPR,
118 ADR_TMC2_ENCA, // Misc
119 ADR_TMC2_ADC_I0_OFS,
120 ADR_TMC2_ADC_I1_OFS,
121 ADR_TMC2_ENC_OFFSET,
122 ADR_TMC2_OFFSETFLUX,
123 ADR_TMC2_TORQUE_P,
124 ADR_TMC2_TORQUE_I,
125 ADR_TMC2_FLUX_P,
126 ADR_TMC2_FLUX_I,
127 ADR_TMC2_PHIE_OFS,
128 ADR_TMC2_TRQ_FILT,
129// AXIS3
130 ADR_AXIS3_CONFIG, // 0-2 ENC, 3-5 DRV
131 ADR_AXIS3_POWER,
132 ADR_AXIS3_DEGREES,
133 ADR_AXIS3_MAX_SPEED, // Store the max speed
134 ADR_AXIS3_MAX_ACCEL, // Store the max accel
135 ADR_AXIS3_ENDSTOP, // 0-7 endstop margin, 8-15 endstop stiffness
136 ADR_AXIS3_EFFECTS1, // 0-7 idlespring, 8-15 damper
137 ADR_AXIS3_SPEEDACCEL_FILTER, // Speed/Accel filter Lowpass profile
138 ADR_AXIS3_ENC_RATIO, // Store the encoder ratio for an axis
139 ADR_AXIS3_EFFECTS2, // 0-7 Friction, 8-15 Inertia
140 ADR_AXIS3_POSTPROCESS1, // 0-7 expo curve
141// TMC3
142 ADR_TMC3_MOTCONF, // 0-2: MotType 3-5: PhiE source 6-15: Poles
143 ADR_TMC3_CPR,
144 ADR_TMC3_ENCA, // Misc
145 ADR_TMC3_ADC_I0_OFS,
146 ADR_TMC3_ADC_I1_OFS,
147 ADR_TMC3_ENC_OFFSET,
148 ADR_TMC3_OFFSETFLUX,
149 ADR_TMC3_TORQUE_P,
150 ADR_TMC3_TORQUE_I,
151 ADR_TMC3_FLUX_P,
152 ADR_TMC3_FLUX_I,
153 ADR_TMC3_PHIE_OFS,
154 ADR_TMC3_TRQ_FILT,
155// RMD CAN Motor
156 ADR_RMD1_DATA1, //0-4 CAN ID
157 ADR_RMD1_TORQUE, //Maximum current
158 ADR_RMD1_OFFSET, //Position offset
159 ADR_RMD2_DATA1,
160 ADR_RMD2_TORQUE,
161 ADR_RMD2_OFFSET,
162// Odrive
163 ADR_ODRIVE_CANID, //0-6 ID M0, 7-12 ID M1, 13-15 can speed
164 ADR_ODRIVE_SETTING1_M0,
165 ADR_ODRIVE_SETTING1_M1,
166 ADR_ODRIVE_OFS_M0, // Encoder offset position reload
167 ADR_ODRIVE_OFS_M1,
168// VESC Section
169 ADR_VESC1_CANID, //0-7 AxisCanID, 8-16 VescCanId
170 ADR_VESC1_DATA, //0-2 can speed, 3 useVescEncoder
171 ADR_VESC1_OFFSET, //16b offset
172 ADR_VESC2_CANID, //0-8 AxisCanID, 8-16 VescCanId
173 ADR_VESC2_DATA, //0-2 can speed, 3 useVescEncoder
174 ADR_VESC2_OFFSET, //16b offset
175 ADR_VESC3_CANID, //0-8 AxisCanID, 8-16 VescCanId
176 ADR_VESC3_DATA, //0-2 can speed, 3 useVescEncoder
177 ADR_VESC3_OFFSET, //16b offset
178//MT Encoder
179 ADR_MTENC_OFS,
180 ADR_MTENC_CONF1,
181// Biss-C
182 ADR_BISSENC_CONF1,
183 ADR_BISSENC_OFS,
184// SSI
185 ADR_SSI_CONF1,
186 ADR_SSI_OFS,
187// Analog min/max calibrations
188 ADR_LOCALANALOG_MIN_0,
189 ADR_LOCALANALOG_MAX_0,
190 ADR_LOCALANALOG_MIN_1,
191 ADR_LOCALANALOG_MAX_1,
192 ADR_LOCALANALOG_MIN_2,
193 ADR_LOCALANALOG_MAX_2,
194 ADR_LOCALANALOG_MIN_3,
195 ADR_LOCALANALOG_MAX_3,
196 ADR_LOCALANALOG_MIN_4,
197 ADR_LOCALANALOG_MAX_4,
198 ADR_LOCALANALOG_MIN_5,
199 ADR_LOCALANALOG_MAX_5,
200 ADR_LOCALANALOG_MIN_6,
201 ADR_LOCALANALOG_MAX_6,
202 ADR_LOCALANALOG_MIN_7,
203 ADR_LOCALANALOG_MAX_7,
204// ADS111X
205 ADR_ADS111X_MIN_0,
206 ADR_ADS111X_MAX_0,
207 ADR_ADS111X_MIN_1,
208 ADR_ADS111X_MAX_1,
209 ADR_ADS111X_MIN_2,
210 ADR_ADS111X_MAX_2,
211 ADR_ADS111X_MIN_3,
212 ADR_ADS111X_MAX_3,
213};
214
218const uint16_t exportableFlashAddresses[NB_EXPORTABLE_ADR] =
219{
220// System variables
221// ADR_HW_VERSION,
222// ADR_SW_VERSION,
223 ADR_FLASH_VERSION,
224 ADR_CURRENT_CONFIG,
225// Ports
226 ADR_CANCONF1,
227 ADR_I2CCONF1,
228// FFBWheel
229 ADR_FFBWHEEL_BUTTONCONF,
230 ADR_FFBWHEEL_ANALOGCONF,
231 ADR_FFBWHEEL_CONF1,
232// CAN remote
233 ADR_CANREMOTE_CONF1,
234 ADR_CANREMOTE_CONF2,
235// Button Sources:
236 ADR_SPI_BTN_1_CONF,
237 ADR_SHIFTERANALOG_CONF,
238 ADR_LOCAL_BTN_CONF, // Pin mask
239 ADR_LOCAL_BTN_CONF_2, // Misc settings
240 ADR_SPI_BTN_2_CONF,
241 ADR_SPI_BTN_1_CONF_2,
242 ADR_SPI_BTN_2_CONF_2,
243 ADR_LOCAL_BTN_CONF_3, // Pulse mask
244// Local encoder
245 ADR_ENCLOCAL_CPR,
246 ADR_ENCLOCAL_OFS,
247// PWM
248 ADR_PWM_MODE,
249// Local analog source
250 ADR_LOCALANALOG_MASK,
251// Shifter Analog
252 ADR_SHIFTERANALOG_X_12,
253 ADR_SHIFTERANALOG_X_56,
254 ADR_SHIFTERANALOG_Y_135,
255 ADR_SHIFTERANALOG_Y_246,
256 ADR_SHIFTERANALOG_CONF_2,
257 ADR_SHIFTERANALOG_CONF_3,
258// PCF buttons
259 ADR_PCFBTN_CONF1,
260// CAN port
261 ADR_CANBTN_CONF1,
262 ADR_CANBTN_CONF2, // CAN ID
263// CAN analog
264// ADR_CANANALOG_CONF1,
265// FFB Engine flash area
266 ADR_FFB_CF_FILTER, // Constant Force Lowpass
267 ADR_FFB_FR_FILTER, // Friction Lowpass
268 ADR_FFB_DA_FILTER, // Damper Lowpass
269 ADR_FFB_IN_FILTER, // Inertia Lowpass
270 ADR_FFB_EFFECTS1, // 0-7 inertia, 8-15 friction
271 ADR_FFB_EFFECTS2, // 0-7 spring, 8-15 damper
272 ADR_FFB_EFFECTS3, // 0-7 friction ramp up zone, 8-9 filterProfile
273// Button Sources:
274 ADR_ADS111X_CONF1,
275// How many axis configured 1-3
276 ADR_AXIS_COUNT,
277// AXIS1
278 ADR_AXIS1_CONFIG, // 0-2 ENC, 3-5 DRV
279 ADR_AXIS1_POWER,
280 ADR_AXIS1_DEGREES,
281 ADR_AXIS1_MAX_SPEED, // Store the max speed
282 ADR_AXIS1_MAX_ACCEL, // Store the max accel
283 ADR_AXIS1_ENDSTOP, // 0-7 endstop margin, 8-15 endstop stiffness
284 ADR_AXIS1_EFFECTS1, // 0-7 idlespring, 8-15 damper
285 ADR_AXIS1_SPEEDACCEL_FILTER, // Speed/Accel filter Lowpass profile
286 ADR_AXIS1_ENC_RATIO, // Accel filter Lowpass
287 ADR_AXIS1_EFFECTS2, // 0-7 Friction, 8-15 Inertia
288 ADR_AXIS1_POSTPROCESS1, // 0-7 expo curve
289// TMC1
290 ADR_TMC1_MOTCONF, // 0-2: MotType 3-5: PhiE source 6-15: Poles
291 ADR_TMC1_CPR,
292 ADR_TMC1_ENCA, // Misc
293// ADR_TMC1_ADC_I0_OFS,
294// ADR_TMC1_ADC_I1_OFS,
295// ADR_TMC1_ENC_OFFSET,
296 ADR_TMC1_OFFSETFLUX,
297 ADR_TMC1_TORQUE_P,
298 ADR_TMC1_TORQUE_I,
299 ADR_TMC1_FLUX_P,
300 ADR_TMC1_FLUX_I,
301// ADR_TMC1_PHIE_OFS,
302 ADR_TMC1_TRQ_FILT,
303// AXIS2
304 ADR_AXIS2_CONFIG, // 0-2 ENC, 3-5 DRV
305 ADR_AXIS2_POWER,
306 ADR_AXIS2_DEGREES,
307 ADR_AXIS2_MAX_SPEED, // Store the max speed
308 ADR_AXIS2_MAX_ACCEL, // Store the max accel
309 ADR_AXIS2_ENDSTOP, // 0-7 endstop margin, 8-15 endstop stiffness
310 ADR_AXIS2_EFFECTS1, // 0-7 idlespring, 8-15 damper
311 ADR_AXIS2_SPEEDACCEL_FILTER, // Speed/Accel filter Lowpass profile
312 ADR_AXIS2_ENC_RATIO, // Store the encoder ratio for an axis
313 ADR_AXIS2_EFFECTS2, // 0-7 Friction, 8-15 Inertia
314 ADR_AXIS2_POSTPROCESS1, // 0-7 expo curve
315// TMC2
316 ADR_TMC2_MOTCONF, // 0-2: MotType 3-5: PhiE source 6-15: Poles
317 ADR_TMC2_CPR,
318 ADR_TMC2_ENCA, // Misc
319// ADR_TMC2_ADC_I0_OFS,
320// ADR_TMC2_ADC_I1_OFS,
321// ADR_TMC2_ENC_OFFSET,
322 ADR_TMC2_OFFSETFLUX,
323 ADR_TMC2_TORQUE_P,
324 ADR_TMC2_TORQUE_I,
325 ADR_TMC2_FLUX_P,
326 ADR_TMC2_FLUX_I,
327// ADR_TMC2_PHIE_OFS,
328 ADR_TMC2_TRQ_FILT,
329// AXIS3
330 ADR_AXIS3_CONFIG, // 0-2 ENC, 3-5 DRV
331 ADR_AXIS3_POWER,
332 ADR_AXIS3_DEGREES,
333 ADR_AXIS3_MAX_SPEED, // Store the max speed
334 ADR_AXIS3_MAX_ACCEL, // Store the max accel
335 ADR_AXIS3_ENDSTOP, // 0-7 endstop margin, 8-15 endstop stiffness
336 ADR_AXIS3_EFFECTS1, // 0-7 idlespring, 8-15 damper
337 ADR_AXIS3_SPEEDACCEL_FILTER, // Speed/Accel filter Lowpass profile
338 ADR_AXIS3_ENC_RATIO, // Store the encoder ratio for an axis
339 ADR_AXIS3_EFFECTS2, // 0-7 Friction, 8-15 Inertia
340 ADR_AXIS3_POSTPROCESS1, // 0-7 expo curve
341// TMC3
342 ADR_TMC3_MOTCONF, // 0-2: MotType 3-5: PhiE source 6-15: Poles
343 ADR_TMC3_CPR,
344 ADR_TMC3_ENCA, // Misc
345// ADR_TMC3_ADC_I0_OFS,
346// ADR_TMC3_ADC_I1_OFS,
347// ADR_TMC3_ENC_OFFSET,
348 ADR_TMC3_OFFSETFLUX,
349 ADR_TMC3_TORQUE_P,
350 ADR_TMC3_TORQUE_I,
351 ADR_TMC3_FLUX_P,
352 ADR_TMC3_FLUX_I,
353// ADR_TMC3_PHIE_OFS,
354 ADR_TMC3_TRQ_FILT,
355// RMD CAN Motor
356 ADR_RMD1_DATA1, //0-4 CAN ID
357 ADR_RMD1_TORQUE, //Maximum current
358 ADR_RMD1_OFFSET, //Position offset
359 ADR_RMD2_DATA1,
360 ADR_RMD2_TORQUE,
361 ADR_RMD2_OFFSET,
362// Odrive
363 ADR_ODRIVE_CANID, //0-6 ID M0, 7-12 ID M1, 13-15 can speed
364 ADR_ODRIVE_SETTING1_M0,
365 ADR_ODRIVE_SETTING1_M1,
366 ADR_ODRIVE_OFS_M0, // Encoder offset position reload
367 ADR_ODRIVE_OFS_M1,
368// VESC Section
369 ADR_VESC1_CANID, //0-7 AxisCanID, 8-16 VescCanId
370 ADR_VESC1_DATA, //0-2 can speed, 3 useVescEncoder
371 ADR_VESC1_OFFSET, //16b offset
372 ADR_VESC2_CANID, //0-8 AxisCanID, 8-16 VescCanId
373 ADR_VESC2_DATA, //0-2 can speed, 3 useVescEncoder
374 ADR_VESC2_OFFSET, //16b offset
375 ADR_VESC3_CANID, //0-8 AxisCanID, 8-16 VescCanId
376 ADR_VESC3_DATA, //0-2 can speed, 3 useVescEncoder
377 ADR_VESC3_OFFSET, //16b offset
378//MT Encoder
379 ADR_MTENC_OFS,
380 ADR_MTENC_CONF1,
381// Biss-C
382 ADR_BISSENC_CONF1,
383 ADR_BISSENC_OFS,
384// SSI
385 ADR_SSI_CONF1,
386 ADR_SSI_OFS,
387// Analog min/max calibrations
388 ADR_LOCALANALOG_MIN_0,
389 ADR_LOCALANALOG_MAX_0,
390 ADR_LOCALANALOG_MIN_1,
391 ADR_LOCALANALOG_MAX_1,
392 ADR_LOCALANALOG_MIN_2,
393 ADR_LOCALANALOG_MAX_2,
394 ADR_LOCALANALOG_MIN_3,
395 ADR_LOCALANALOG_MAX_3,
396 ADR_LOCALANALOG_MIN_4,
397 ADR_LOCALANALOG_MAX_4,
398 ADR_LOCALANALOG_MIN_5,
399 ADR_LOCALANALOG_MAX_5,
400 ADR_LOCALANALOG_MIN_6,
401 ADR_LOCALANALOG_MAX_6,
402 ADR_LOCALANALOG_MIN_7,
403 ADR_LOCALANALOG_MAX_7,
404// ADS111X
405 ADR_ADS111X_MIN_0,
406 ADR_ADS111X_MAX_0,
407 ADR_ADS111X_MIN_1,
408 ADR_ADS111X_MAX_1,
409 ADR_ADS111X_MIN_2,
410 ADR_ADS111X_MAX_2,
411 ADR_ADS111X_MIN_3,
412 ADR_ADS111X_MAX_3,
413};
const uint16_t VirtAddVarTab[NB_OF_VAR]
const uint16_t exportableFlashAddresses[NB_EXPORTABLE_ADR]