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 164
17extern const uint16_t VirtAddVarTab[NB_OF_VAR];
18
19// Amount of variables in exportable list
20#define NB_EXPORTABLE_ADR 149
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// CAN remote
51#define ADR_CANREMOTE_CONF1 0x120
52#define ADR_CANREMOTE_CONF2 0x121
53// Button Sources:
54#define ADR_SPI_BTN_1_CONF 0x201
55#define ADR_SHIFTERANALOG_CONF 0x202
56#define ADR_LOCAL_BTN_CONF 0x203 // Pin mask
57#define ADR_LOCAL_BTN_CONF_2 0x204 // Misc settings
58#define ADR_SPI_BTN_2_CONF 0x205
59#define ADR_SPI_BTN_1_CONF_2 0x206
60#define ADR_SPI_BTN_2_CONF_2 0x207
61#define ADR_LOCAL_BTN_CONF_3 0x208 // Pulse mask
62// Local encoder
63#define ADR_ENCLOCAL_CPR 0x210
64#define ADR_ENCLOCAL_OFS 0x211
65// PWM
66#define ADR_PWM_MODE 0x220
67// Local analog source
68#define ADR_LOCALANALOG_MASK 0x230
69// Shifter Analog
70#define ADR_SHIFTERANALOG_X_12 0x240
71#define ADR_SHIFTERANALOG_X_56 0x241
72#define ADR_SHIFTERANALOG_Y_135 0x242
73#define ADR_SHIFTERANALOG_Y_246 0x243
74#define ADR_SHIFTERANALOG_CONF_2 0x244
75#define ADR_SHIFTERANALOG_CONF_3 0x245
76// PCF buttons
77#define ADR_PCFBTN_CONF1 0x250
78// CAN port
79#define ADR_CANBTN_CONF1 0x260
80#define ADR_CANBTN_CONF2 0x261 // CAN ID
81// CAN analog
82#define ADR_CANANALOG_CONF1 0x270
83// FFB Engine flash area
84#define ADR_FFB_CF_FILTER 0x280 // Constant Force Lowpass
85#define ADR_FFB_FR_FILTER 0x281 // Friction Lowpass
86#define ADR_FFB_DA_FILTER 0x282 // Damper Lowpass
87#define ADR_FFB_IN_FILTER 0x283 // Inertia Lowpass
88#define ADR_FFB_EFFECTS1 0x284 // 0-7 inertia, 8-15 friction
89#define ADR_FFB_EFFECTS2 0x285 // 0-7 spring, 8-15 damper
90#define ADR_FFB_EFFECTS3 0x286 // 0-7 friction ramp up zone, 8-9 filterProfile
91// Button Sources:
92#define ADR_ADS111X_CONF1 0x290
93// How many axis configured 1-3
94#define ADR_AXIS_COUNT 0x300
95// AXIS1
96#define ADR_AXIS1_CONFIG 0x301 // 0-2 ENC, 3-5 DRV
97#define ADR_AXIS1_POWER 0x302
98#define ADR_AXIS1_DEGREES 0x303
99#define ADR_AXIS1_MAX_SPEED 0x304 // Store the max speed
100#define ADR_AXIS1_MAX_ACCEL 0x305 // Store the max accel
101#define ADR_AXIS1_ENDSTOP 0x307 // 0-7 endstop margin, 8-15 endstop stiffness
102#define ADR_AXIS1_EFFECTS1 0x308 // 0-7 idlespring, 8-15 damper
103#define ADR_AXIS1_SPEEDACCEL_FILTER 0x309 // Speed/Accel filter Lowpass profile
104#define ADR_AXIS1_ENC_RATIO 0x30A // Accel filter Lowpass
105#define ADR_AXIS1_EFFECTS2 0x30B // 0-7 Friction, 8-15 Inertia
106#define ADR_AXIS1_POSTPROCESS1 0x30C // 0-7 expo curve
107// TMC1
108#define ADR_TMC1_MOTCONF 0x320 // 0-2: MotType 3-5: PhiE source 6-15: Poles
109#define ADR_TMC1_CPR 0x321
110#define ADR_TMC1_ENCA 0x322 // Misc
111#define ADR_TMC1_ADC_I0_OFS 0x323
112#define ADR_TMC1_ADC_I1_OFS 0x324
113#define ADR_TMC1_ENC_OFFSET 0x325
114#define ADR_TMC1_OFFSETFLUX 0x326
115#define ADR_TMC1_TORQUE_P 0x327
116#define ADR_TMC1_TORQUE_I 0x328
117#define ADR_TMC1_FLUX_P 0x329
118#define ADR_TMC1_FLUX_I 0x32A
119#define ADR_TMC1_PHIE_OFS 0x32B
120#define ADR_TMC1_TRQ_FILT 0x32C
121// AXIS2
122#define ADR_AXIS2_CONFIG 0x341 // 0-2 ENC, 3-5 DRV
123#define ADR_AXIS2_POWER 0x342
124#define ADR_AXIS2_DEGREES 0x343
125#define ADR_AXIS2_MAX_SPEED 0x344 // Store the max speed
126#define ADR_AXIS2_MAX_ACCEL 0x345 // Store the max accel
127#define ADR_AXIS2_ENDSTOP 0x347 // 0-7 endstop margin, 8-15 endstop stiffness
128#define ADR_AXIS2_EFFECTS1 0x348 // 0-7 idlespring, 8-15 damper
129#define ADR_AXIS2_SPEEDACCEL_FILTER 0x349 // Speed/Accel filter Lowpass profile
130#define ADR_AXIS2_ENC_RATIO 0x34A // Store the encoder ratio for an axis
131#define ADR_AXIS2_EFFECTS2 0x34B // 0-7 Friction, 8-15 Inertia
132#define ADR_AXIS2_POSTPROCESS1 0x34C // 0-7 expo curve
133// TMC2
134#define ADR_TMC2_MOTCONF 0x360 // 0-2: MotType 3-5: PhiE source 6-15: Poles
135#define ADR_TMC2_CPR 0x361
136#define ADR_TMC2_ENCA 0x362 // Misc
137#define ADR_TMC2_ADC_I0_OFS 0x363
138#define ADR_TMC2_ADC_I1_OFS 0x364
139#define ADR_TMC2_ENC_OFFSET 0x365
140#define ADR_TMC2_OFFSETFLUX 0x366
141#define ADR_TMC2_TORQUE_P 0x367
142#define ADR_TMC2_TORQUE_I 0x368
143#define ADR_TMC2_FLUX_P 0x369
144#define ADR_TMC2_FLUX_I 0x36A
145#define ADR_TMC2_PHIE_OFS 0x36B
146#define ADR_TMC2_TRQ_FILT 0x36C
147// AXIS3
148#define ADR_AXIS3_CONFIG 0x381 // 0-2 ENC, 3-5 DRV
149#define ADR_AXIS3_POWER 0x382
150#define ADR_AXIS3_DEGREES 0x383
151#define ADR_AXIS3_MAX_SPEED 0x384 // Store the max speed
152#define ADR_AXIS3_MAX_ACCEL 0x385 // Store the max accel
153#define ADR_AXIS3_ENDSTOP 0x387 // 0-7 endstop margin, 8-15 endstop stiffness
154#define ADR_AXIS3_EFFECTS1 0x388 // 0-7 idlespring, 8-15 damper
155#define ADR_AXIS3_SPEEDACCEL_FILTER 0x389 // Speed/Accel filter Lowpass profile
156#define ADR_AXIS3_ENC_RATIO 0x38A // Store the encoder ratio for an axis
157#define ADR_AXIS3_EFFECTS2 0x38B // 0-7 Friction, 8-15 Inertia
158#define ADR_AXIS3_POSTPROCESS1 0x38C // 0-7 expo curve
159// TMC3
160#define ADR_TMC3_MOTCONF 0x3A0 // 0-2: MotType 3-5: PhiE source 6-15: Poles
161#define ADR_TMC3_CPR 0x3A1
162#define ADR_TMC3_ENCA 0x3A2 // Misc
163#define ADR_TMC3_ADC_I0_OFS 0x3A3
164#define ADR_TMC3_ADC_I1_OFS 0x3A4
165#define ADR_TMC3_ENC_OFFSET 0x3A5
166#define ADR_TMC3_OFFSETFLUX 0x3A6
167#define ADR_TMC3_TORQUE_P 0x3A7
168#define ADR_TMC3_TORQUE_I 0x3A8
169#define ADR_TMC3_FLUX_P 0x3A9
170#define ADR_TMC3_FLUX_I 0x3AA
171#define ADR_TMC3_PHIE_OFS 0x3AB
172#define ADR_TMC3_TRQ_FILT 0x3AC
173// RMD CAN Motor
174#define ADR_RMD1_DATA1 0x3C0 //0-4 CAN ID
175#define ADR_RMD1_TORQUE 0x3C1 //Maximum current
176#define ADR_RMD1_OFFSET 0x3C2 //Position offset
177#define ADR_RMD2_DATA1 0x3C3
178#define ADR_RMD2_TORQUE 0x3C4
179#define ADR_RMD2_OFFSET 0x3C5
180// Odrive
181#define ADR_ODRIVE_CANID 0x3D0 //0-6 ID M0, 7-12 ID M1, 13-15 can speed
182#define ADR_ODRIVE_SETTING1_M0 0x3D1
183#define ADR_ODRIVE_SETTING1_M1 0x3D2
184#define ADR_ODRIVE_OFS_M0 0x3D3 // Encoder offset position reload
185#define ADR_ODRIVE_OFS_M1 0x3D4
186// VESC Section
187#define ADR_VESC1_CANID 0x3E0 //0-7 AxisCanID, 8-16 VescCanId
188#define ADR_VESC1_DATA 0x3E1 //0-2 can speed, 3 useVescEncoder
189#define ADR_VESC1_OFFSET 0x3E2 //16b offset
190#define ADR_VESC2_CANID 0x3E3 //0-8 AxisCanID, 8-16 VescCanId
191#define ADR_VESC2_DATA 0x3E4 //0-2 can speed, 3 useVescEncoder
192#define ADR_VESC2_OFFSET 0x3E5 //16b offset
193#define ADR_VESC3_CANID 0x3E6 //0-8 AxisCanID, 8-16 VescCanId
194#define ADR_VESC3_DATA 0x3E7 //0-2 can speed, 3 useVescEncoder
195#define ADR_VESC3_OFFSET 0x3E8 //16b offset
196//MT Encoder
197#define ADR_MTENC_OFS 0x400
198#define ADR_MTENC_CONF1 0x401
199// Biss-C
200#define ADR_BISSENC_CONF1 0x410
201#define ADR_BISSENC_OFS 0x411
202// SSI
203#define ADR_SSI_CONF1 0x413
204#define ADR_SSI_OFS 0x414
205// Analog min/max calibrations
206#define ADR_LOCALANALOG_MIN_0 0x500
207#define ADR_LOCALANALOG_MAX_0 0x501
208#define ADR_LOCALANALOG_MIN_1 0x502
209#define ADR_LOCALANALOG_MAX_1 0x503
210#define ADR_LOCALANALOG_MIN_2 0x504
211#define ADR_LOCALANALOG_MAX_2 0x505
212#define ADR_LOCALANALOG_MIN_3 0x506
213#define ADR_LOCALANALOG_MAX_3 0x507
214#define ADR_LOCALANALOG_MIN_4 0x508
215#define ADR_LOCALANALOG_MAX_4 0x509
216#define ADR_LOCALANALOG_MIN_5 0x50A
217#define ADR_LOCALANALOG_MAX_5 0x50B
218#define ADR_LOCALANALOG_MIN_6 0x50C
219#define ADR_LOCALANALOG_MAX_6 0x50D
220#define ADR_LOCALANALOG_MIN_7 0x50E
221#define ADR_LOCALANALOG_MAX_7 0x50F
222// ADS111X
223#define ADR_ADS111X_MIN_0 0x510
224#define ADR_ADS111X_MAX_0 0x511
225#define ADR_ADS111X_MIN_1 0x512
226#define ADR_ADS111X_MAX_1 0x513
227#define ADR_ADS111X_MIN_2 0x514
228#define ADR_ADS111X_MAX_2 0x515
229#define ADR_ADS111X_MIN_3 0x516
230#define ADR_ADS111X_MAX_3 0x517
231#endif /* EEPROM_ADDRESSES_H_ */
const uint16_t VirtAddVarTab[NB_OF_VAR]
const uint16_t exportableFlashAddresses[NB_EXPORTABLE_ADR]