Rev 2116 | Rev 2125 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1910 | - | 1 | #ifndef _EEPROM_H |
2 | #define _EEPROM_H |
||
3 | |||
4 | #include <inttypes.h> |
||
5 | #include "configuration.h" |
||
2099 | - | 6 | #include "analog.h" |
1910 | - | 7 | |
8 | #define EEPROM_ADR_PARAM_BEGIN 0 |
||
2099 | - | 9 | #define EEPROM_CHECKSUMMED_BLOCK_OVERHEAD 3 |
1910 | - | 10 | |
2099 | - | 11 | #define PID_ACTIVE_SET 0 // byte |
12 | //#define EEPROM_ADR_ACCOFFSET 1 |
||
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) |
||
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) |
||
1910 | - | 17 | |
2105 | - | 18 | #define EEPROM_ADR_AIRSPEEDOFFSET 16 |
19 | |||
2099 | - | 20 | #define EEPROM_ADR_GYROOFFSET 32 |
21 | #define EEPROM_ADR_GYROAMPLIFIER 48 |
||
22 | #define EEPROM_ADR_CHANNELMAP 64 |
||
2122 | - | 23 | #define EEPROM_ADR_RCTRIM 96 |
24 | #define EEPROM_ADR_IMU_CONFIG 128 |
||
2099 | - | 25 | #define EEPROM_ADR_PARAMSET_BEGIN 256 |
1910 | - | 26 | |
2116 | - | 27 | #define CHANNELMAP_REVISION 1 |
2114 | - | 28 | #define EEPARAM_REVISION 100 |
2099 | - | 29 | #define EEMIXER_REVISION 0 |
30 | #define SENSOROFFSET_REVISION 0 |
||
31 | #define IMUCONFIG_REVISION 0 |
||
1910 | - | 32 | |
2099 | - | 33 | void paramSet_readOrDefault(void); |
34 | void channelMap_readOrDefault(void); |
||
2122 | - | 35 | void rcTrim_readOrDefault(void); |
2099 | - | 36 | void IMUConfig_readOrDefault(void); |
2103 | - | 37 | void IMUConfig_writeToEEprom(void); |
1910 | - | 38 | |
2099 | - | 39 | uint8_t paramSet_readFromEEProm(uint8_t setnumber); |
40 | void paramSet_writeToEEProm(uint8_t setnumber); |
||
41 | |||
42 | void channelMap_writeToEEProm(void); |
||
43 | |||
44 | uint8_t gyroOffset_readFromEEProm(void); |
||
45 | void gyroOffset_writeToEEProm(void); |
||
46 | |||
2105 | - | 47 | uint8_t airpressureOffset_readFromEEProm(void); |
48 | void airpressureOffset_writeToEEProm(void); |
||
49 | |||
2099 | - | 50 | //uint8_t accOffset_readFromEEProm(void); |
51 | //void accOffset_writeToEEProm(void); |
||
52 | |||
53 | uint8_t getParamByte(uint16_t param_id); |
||
54 | void setParamByte(uint16_t param_id, uint8_t value); |
||
55 | |||
56 | // We have only a single param set here. |
||
57 | // uint8_t getActiveParamSet(void); |
||
58 | // void setActiveParamSet(uint8_t setnumber); |
||
59 | |||
1910 | - | 60 | #endif //_EEPROM_H |