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