Rev 2099 | Rev 2105 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2099 | Rev 2103 | ||
---|---|---|---|
1 | #ifndef _EEPROM_H |
1 | #ifndef _EEPROM_H |
2 | #define _EEPROM_H |
2 | #define _EEPROM_H |
3 | 3 | ||
4 | #include <inttypes.h> |
4 | #include <inttypes.h> |
5 | #include "configuration.h" |
5 | #include "configuration.h" |
6 | #include "analog.h" |
6 | #include "analog.h" |
7 | 7 | ||
8 | #define EEPROM_ADR_PARAM_BEGIN 0 |
8 | #define EEPROM_ADR_PARAM_BEGIN 0 |
9 | #define EEPROM_CHECKSUMMED_BLOCK_OVERHEAD 3 |
9 | #define EEPROM_CHECKSUMMED_BLOCK_OVERHEAD 3 |
10 | 10 | ||
11 | #define PID_ACTIVE_SET 0 // byte |
11 | #define PID_ACTIVE_SET 0 // byte |
12 | //#define EEPROM_ADR_ACCOFFSET 1 |
12 | //#define EEPROM_ADR_ACCOFFSET 1 |
13 | //#define EEPROM_ADR_GYROOFFSET (EEPROM_ADR_ACCOFFSET+sizeof(sensorOffset_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD) |
13 | //#define EEPROM_ADR_GYROOFFSET (EEPROM_ADR_ACCOFFSET+sizeof(sensorOffset_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD) |
14 | //#define EEPROM_ADR_GYROAMPLIFIER (EEPROM_ADR_GYROOFFSET+sizeof(sensorOffset_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD) |
14 | //#define EEPROM_ADR_GYROAMPLIFIER (EEPROM_ADR_GYROOFFSET+sizeof(sensorOffset_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD) |
15 | //#define EEPROM_ADR_CHANNELMAP (EEPROM_ADR_GYROAMPLIFIER+sizeof(sensorOffset_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD) |
15 | //#define EEPROM_ADR_CHANNELMAP (EEPROM_ADR_GYROAMPLIFIER+sizeof(sensorOffset_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD) |
16 | //#define EEPROM_ADR_PARAMSET_BEGIN (EEPROM_ADR_MIXER_TABLE+sizeof(mixerMatrix_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD) |
16 | //#define EEPROM_ADR_PARAMSET_BEGIN (EEPROM_ADR_MIXER_TABLE+sizeof(mixerMatrix_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD) |
17 | 17 | ||
18 | #define EEPROM_ADR_ACCOFFSET 16 |
18 | #define EEPROM_ADR_ACCOFFSET 16 |
19 | #define EEPROM_ADR_GYROOFFSET 32 |
19 | #define EEPROM_ADR_GYROOFFSET 32 |
20 | #define EEPROM_ADR_GYROAMPLIFIER 48 |
20 | #define EEPROM_ADR_GYROAMPLIFIER 48 |
21 | #define EEPROM_ADR_CHANNELMAP 64 |
21 | #define EEPROM_ADR_CHANNELMAP 64 |
22 | #define EEPROM_ADR_IMU_CONFIG 100 |
22 | #define EEPROM_ADR_IMU_CONFIG 100 |
23 | #define EEPROM_ADR_PARAMSET_BEGIN 256 |
23 | #define EEPROM_ADR_PARAMSET_BEGIN 256 |
24 | 24 | ||
25 | #define CHANNELMAP_REVISION 0 |
25 | #define CHANNELMAP_REVISION 0 |
26 | #define EEPARAM_REVISION 4 |
26 | #define EEPARAM_REVISION 4 |
27 | #define EEMIXER_REVISION 0 |
27 | #define EEMIXER_REVISION 0 |
28 | #define SENSOROFFSET_REVISION 0 |
28 | #define SENSOROFFSET_REVISION 0 |
29 | #define IMUCONFIG_REVISION 0 |
29 | #define IMUCONFIG_REVISION 0 |
30 | 30 | ||
31 | void paramSet_readOrDefault(void); |
31 | void paramSet_readOrDefault(void); |
32 | void channelMap_readOrDefault(void); |
32 | void channelMap_readOrDefault(void); |
33 | void IMUConfig_readOrDefault(void); |
33 | void IMUConfig_readOrDefault(void); |
- | 34 | void IMUConfig_writeToEEprom(void); |
|
34 | 35 | ||
35 | uint8_t paramSet_readFromEEProm(uint8_t setnumber); |
36 | uint8_t paramSet_readFromEEProm(uint8_t setnumber); |
36 | void paramSet_writeToEEProm(uint8_t setnumber); |
37 | void paramSet_writeToEEProm(uint8_t setnumber); |
37 | 38 | ||
38 | void channelMap_writeToEEProm(void); |
39 | void channelMap_writeToEEProm(void); |
39 | 40 | ||
40 | uint8_t gyroOffset_readFromEEProm(void); |
41 | uint8_t gyroOffset_readFromEEProm(void); |
41 | void gyroOffset_writeToEEProm(void); |
42 | void gyroOffset_writeToEEProm(void); |
42 | 43 | ||
43 | //uint8_t accOffset_readFromEEProm(void); |
44 | //uint8_t accOffset_readFromEEProm(void); |
44 | //void accOffset_writeToEEProm(void); |
45 | //void accOffset_writeToEEProm(void); |
45 | 46 | ||
46 | uint8_t getParamByte(uint16_t param_id); |
47 | uint8_t getParamByte(uint16_t param_id); |
47 | void setParamByte(uint16_t param_id, uint8_t value); |
48 | void setParamByte(uint16_t param_id, uint8_t value); |
48 | 49 | ||
49 | // We have only a single param set here. |
50 | // We have only a single param set here. |
50 | // uint8_t getActiveParamSet(void); |
51 | // uint8_t getActiveParamSet(void); |
51 | // void setActiveParamSet(uint8_t setnumber); |
52 | // void setActiveParamSet(uint8_t setnumber); |
52 | 53 | ||
53 | #endif //_EEPROM_H |
54 | #endif //_EEPROM_H |
54 | 55 |