Open FFBoard
Open source force feedback firmware
eeprom_addresses.h
Go to the documentation of this file.
1/*
2 * eeprom_addresses.h
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#ifndef EEPROM_ADDRESSES_H_
12#define EEPROM_ADDRESSES_H_
13
14#include "main.h"
15// Change this to the amount of currently registered variables
16#define NB_OF_VAR 159
17extern const uint16_t VirtAddVarTab[NB_OF_VAR];
18
19// Amount of variables in exportable list
20#define NB_EXPORTABLE_ADR 144
21extern const uint16_t exportableFlashAddresses[NB_EXPORTABLE_ADR];
22
23
24
25/* Add your addresses here. 0xffff is invalid as it marks an erased field.
26Anything below 0x00ff is reserved for system variables.
27
28Use ranges that are clear to distinguish between configurations. Address ranges can have gaps.
29Label the names clearly.
30Example: 0x0100 - 0x01ff for one class and 0x0200-0x02ff for another class would be reasonable even if they each need only 3 variables
31
32
33Important: Add your variable to the VirtAddVarTab[NB_OF_VAR] array in eeprom_addresses.c!
34
35Tip to check if a cell is intialized:
36uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) will return 1 if the address is not found or 0 if it was found.
37*/
38// System variables
39#define ADR_HW_VERSION 1
40#define ADR_SW_VERSION 2
41#define ADR_FLASH_VERSION 4
42#define ADR_CURRENT_CONFIG 10
43// Ports
44#define ADR_CANCONF1 0xC1
45#define ADR_I2CCONF1 0xC2
46// FFBWheel
47#define ADR_FFBWHEEL_BUTTONCONF 0x101
48#define ADR_FFBWHEEL_ANALOGCONF 0x102
49#define ADR_FFBWHEEL_CONF1 0x103
50// Button Sources:
51#define ADR_SPI_BTN_1_CONF 0x201
52#define ADR_SHIFTERANALOG_CONF 0x202
53#define ADR_LOCAL_BTN_CONF 0x203 // Pin mask
54#define ADR_LOCAL_BTN_CONF_2 0x204 // Misc settings
55#define ADR_SPI_BTN_2_CONF 0x205
56#define ADR_SPI_BTN_1_CONF_2 0x206
57#define ADR_SPI_BTN_2_CONF_2 0x207
58#define ADR_LOCAL_BTN_CONF_3 0x208 // Pulse mask
59// Local encoder
60#define ADR_ENCLOCAL_CPR 0x210
61#define ADR_ENCLOCAL_OFS 0x211
62// PWM
63#define ADR_PWM_MODE 0x220
64// Local analog source
65#define ADR_LOCALANALOG_MASK 0x230
66// Shifter Analog
67#define ADR_SHIFTERANALOG_X_12 0x240
68#define ADR_SHIFTERANALOG_X_56 0x241
69#define ADR_SHIFTERANALOG_Y_135 0x242
70#define ADR_SHIFTERANALOG_Y_246 0x243
71#define ADR_SHIFTERANALOG_CONF_2 0x244
72#define ADR_SHIFTERANALOG_CONF_3 0x245
73// PCF buttons
74#define ADR_PCFBTN_CONF1 0x250
75// CAN port
76#define ADR_CANBTN_CONF1 0x260
77#define ADR_CANBTN_CONF2 0x261 // CAN ID
78// CAN analog
79#define ADR_CANANALOG_CONF1 0x270
80// FFB Engine flash area
81#define ADR_FFB_CF_FILTER 0x280 // Constant Force Lowpass
82#define ADR_FFB_FR_FILTER 0x281 // Friction Lowpass
83#define ADR_FFB_DA_FILTER 0x282 // Damper Lowpass
84#define ADR_FFB_IN_FILTER 0x283 // Inertia Lowpass
85#define ADR_FFB_EFFECTS1 0x284 // 0-7 inertia, 8-15 friction
86#define ADR_FFB_EFFECTS2 0x285 // 0-7 spring, 8-15 damper
87#define ADR_FFB_EFFECTS3 0x286 // 0-7 friction ramp up zone, 8-9 filterProfile
88// Button Sources:
89#define ADR_ADS111X_CONF1 0x290
90// How many axis configured 1-3
91#define ADR_AXIS_COUNT 0x300
92// AXIS1
93#define ADR_AXIS1_CONFIG 0x301 // 0-2 ENC, 3-5 DRV
94#define ADR_AXIS1_POWER 0x302
95#define ADR_AXIS1_DEGREES 0x303
96#define ADR_AXIS1_MAX_SPEED 0x304 // Store the max speed
97#define ADR_AXIS1_MAX_ACCEL 0x305 // Store the max accel
98#define ADR_AXIS1_ENDSTOP 0x307 // 0-7 endstop margin, 8-15 endstop stiffness
99#define ADR_AXIS1_EFFECTS1 0x308 // 0-7 idlespring, 8-15 damper
100#define ADR_AXIS1_SPEEDACCEL_FILTER 0x309 // Speed/Accel filter Lowpass profile
101#define ADR_AXIS1_ENC_RATIO 0x30A // Accel filter Lowpass
102#define ADR_AXIS1_EFFECTS2 0x30B // 0-7 Friction, 8-15 Inertia
103// TMC1
104#define ADR_TMC1_MOTCONF 0x320 // 0-2: MotType 3-5: PhiE source 6-15: Poles
105#define ADR_TMC1_CPR 0x321
106#define ADR_TMC1_ENCA 0x322 // Misc
107#define ADR_TMC1_ADC_I0_OFS 0x323
108#define ADR_TMC1_ADC_I1_OFS 0x324
109#define ADR_TMC1_ENC_OFFSET 0x325
110#define ADR_TMC1_OFFSETFLUX 0x326
111#define ADR_TMC1_TORQUE_P 0x327
112#define ADR_TMC1_TORQUE_I 0x328
113#define ADR_TMC1_FLUX_P 0x329
114#define ADR_TMC1_FLUX_I 0x32A
115#define ADR_TMC1_PHIE_OFS 0x32B
116#define ADR_TMC1_TRQ_FILT 0x32C
117// AXIS2
118#define ADR_AXIS2_CONFIG 0x341 // 0-2 ENC, 3-5 DRV
119#define ADR_AXIS2_POWER 0x342
120#define ADR_AXIS2_DEGREES 0x343
121#define ADR_AXIS2_MAX_SPEED 0x344 // Store the max speed
122#define ADR_AXIS2_MAX_ACCEL 0x345 // Store the max accel
123#define ADR_AXIS2_ENDSTOP 0x347 // 0-7 endstop margin, 8-15 endstop stiffness
124#define ADR_AXIS2_EFFECTS1 0x348 // 0-7 idlespring, 8-15 damper
125#define ADR_AXIS2_SPEEDACCEL_FILTER 0x349 // Speed/Accel filter Lowpass profile
126#define ADR_AXIS2_ENC_RATIO 0x34A // Store the encoder ratio for an axis
127#define ADR_AXIS2_EFFECTS2 0x34B // 0-7 Friction, 8-15 Inertia
128// TMC2
129#define ADR_TMC2_MOTCONF 0x360 // 0-2: MotType 3-5: PhiE source 6-15: Poles
130#define ADR_TMC2_CPR 0x361
131#define ADR_TMC2_ENCA 0x362 // Misc
132#define ADR_TMC2_ADC_I0_OFS 0x363
133#define ADR_TMC2_ADC_I1_OFS 0x364
134#define ADR_TMC2_ENC_OFFSET 0x365
135#define ADR_TMC2_OFFSETFLUX 0x366
136#define ADR_TMC2_TORQUE_P 0x367
137#define ADR_TMC2_TORQUE_I 0x368
138#define ADR_TMC2_FLUX_P 0x369
139#define ADR_TMC2_FLUX_I 0x36A
140#define ADR_TMC2_PHIE_OFS 0x36B
141#define ADR_TMC2_TRQ_FILT 0x36C
142// AXIS3
143#define ADR_AXIS3_CONFIG 0x381 // 0-2 ENC, 3-5 DRV
144#define ADR_AXIS3_POWER 0x382
145#define ADR_AXIS3_DEGREES 0x383
146#define ADR_AXIS3_MAX_SPEED 0x384 // Store the max speed
147#define ADR_AXIS3_MAX_ACCEL 0x385 // Store the max accel
148#define ADR_AXIS3_ENDSTOP 0x387 // 0-7 endstop margin, 8-15 endstop stiffness
149#define ADR_AXIS3_EFFECTS1 0x388 // 0-7 idlespring, 8-15 damper
150#define ADR_AXIS3_SPEEDACCEL_FILTER 0x389 // Speed/Accel filter Lowpass profile
151#define ADR_AXIS3_ENC_RATIO 0x38A // Store the encoder ratio for an axis
152#define ADR_AXIS3_EFFECTS2 0x38B // 0-7 Friction, 8-15 Inertia
153// TMC3
154#define ADR_TMC3_MOTCONF 0x3A0 // 0-2: MotType 3-5: PhiE source 6-15: Poles
155#define ADR_TMC3_CPR 0x3A1
156#define ADR_TMC3_ENCA 0x3A2 // Misc
157#define ADR_TMC3_ADC_I0_OFS 0x3A3
158#define ADR_TMC3_ADC_I1_OFS 0x3A4
159#define ADR_TMC3_ENC_OFFSET 0x3A5
160#define ADR_TMC3_OFFSETFLUX 0x3A6
161#define ADR_TMC3_TORQUE_P 0x3A7
162#define ADR_TMC3_TORQUE_I 0x3A8
163#define ADR_TMC3_FLUX_P 0x3A9
164#define ADR_TMC3_FLUX_I 0x3AA
165#define ADR_TMC3_PHIE_OFS 0x3AB
166#define ADR_TMC3_TRQ_FILT 0x3AC
167// RMD CAN Motor
168#define ADR_RMD1_DATA1 0x3C0 //0-4 CAN ID
169#define ADR_RMD1_TORQUE 0x3C1 //Maximum current
170#define ADR_RMD1_OFFSET 0x3C2 //Position offset
171#define ADR_RMD2_DATA1 0x3C3
172#define ADR_RMD2_TORQUE 0x3C4
173#define ADR_RMD2_OFFSET 0x3C5
174// Odrive
175#define ADR_ODRIVE_CANID 0x3D0 //0-6 ID M0, 7-12 ID M1, 13-15 can speed
176#define ADR_ODRIVE_SETTING1_M0 0x3D1
177#define ADR_ODRIVE_SETTING1_M1 0x3D2
178#define ADR_ODRIVE_OFS_M0 0x3D3 // Encoder offset position reload
179#define ADR_ODRIVE_OFS_M1 0x3D4
180// VESC Section
181#define ADR_VESC1_CANID 0x3E0 //0-7 AxisCanID, 8-16 VescCanId
182#define ADR_VESC1_DATA 0x3E1 //0-2 can speed, 3 useVescEncoder
183#define ADR_VESC1_OFFSET 0x3E2 //16b offset
184#define ADR_VESC2_CANID 0x3E3 //0-8 AxisCanID, 8-16 VescCanId
185#define ADR_VESC2_DATA 0x3E4 //0-2 can speed, 3 useVescEncoder
186#define ADR_VESC2_OFFSET 0x3E5 //16b offset
187#define ADR_VESC3_CANID 0x3E6 //0-8 AxisCanID, 8-16 VescCanId
188#define ADR_VESC3_DATA 0x3E7 //0-2 can speed, 3 useVescEncoder
189#define ADR_VESC3_OFFSET 0x3E8 //16b offset
190//MT Encoder
191#define ADR_MTENC_OFS 0x400
192#define ADR_MTENC_CONF1 0x401
193// Biss-C
194#define ADR_BISSENC_CONF1 0x410
195#define ADR_BISSENC_OFS 0x411
196// SSI
197#define ADR_SSI_CONF1 0x413
198#define ADR_SSI_OFS 0x414
199// Analog min/max calibrations
200#define ADR_LOCALANALOG_MIN_0 0x500
201#define ADR_LOCALANALOG_MAX_0 0x501
202#define ADR_LOCALANALOG_MIN_1 0x502
203#define ADR_LOCALANALOG_MAX_1 0x503
204#define ADR_LOCALANALOG_MIN_2 0x504
205#define ADR_LOCALANALOG_MAX_2 0x505
206#define ADR_LOCALANALOG_MIN_3 0x506
207#define ADR_LOCALANALOG_MAX_3 0x507
208#define ADR_LOCALANALOG_MIN_4 0x508
209#define ADR_LOCALANALOG_MAX_4 0x509
210#define ADR_LOCALANALOG_MIN_5 0x50A
211#define ADR_LOCALANALOG_MAX_5 0x50B
212#define ADR_LOCALANALOG_MIN_6 0x50C
213#define ADR_LOCALANALOG_MAX_6 0x50D
214#define ADR_LOCALANALOG_MIN_7 0x50E
215#define ADR_LOCALANALOG_MAX_7 0x50F
216#define ADR_ADS111X_MIN_0 0x510
217#define ADR_ADS111X_MAX_0 0x511
218#define ADR_ADS111X_MIN_1 0x512
219#define ADR_ADS111X_MAX_1 0x513
220#define ADR_ADS111X_MIN_2 0x514
221#define ADR_ADS111X_MAX_2 0x515
222#define ADR_ADS111X_MIN_3 0x516
223#define ADR_ADS111X_MAX_3 0x517
224#endif /* EEPROM_ADDRESSES_H_ */
const uint16_t VirtAddVarTab[NB_OF_VAR]
const uint16_t exportableFlashAddresses[NB_EXPORTABLE_ADR]