Subversion Repositories FlightCtrl

Rev

Rev 2158 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1612 dongfang 1
#ifndef _EEPROM_H
2
#define _EEPROM_H
3
 
4
#include <inttypes.h>
5
#include "configuration.h"
1960 - 6
#include "analog.h"
1612 dongfang 7
 
8
#define EEPROM_ADR_PARAM_BEGIN  0
1968 - 9
#define EEPROM_CHECKSUMMED_BLOCK_OVERHEAD 3
1960 - 10
 
1969 - 11
#define PID_ACTIVE_SET                  0   // byte
12
//#define EEPROM_ADR_ACCOFFSET          1
2156 - 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_MIXER_TABLE                (EEPROM_ADR_CHANNELMAP+sizeof(ChannelMap_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD)
17
//#define EEPROM_ADR_PARAMSET_BEGIN     (EEPROM_ADR_MIXER_TABLE+sizeof(MixerMatrix_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD)
1960 - 18
 
1969 - 19
#define EEPROM_ADR_ACCOFFSET            16
20
#define EEPROM_ADR_GYROOFFSET           32
21
#define EEPROM_ADR_GYROAMPLIFIER    48
22
#define EEPROM_ADR_CHANNELMAP           64
2092 - 23
#define EEPROM_ADR_IMU_CONFIG       100
24
#define EEPROM_ADR_MIXER_TABLE      128
1969 - 25
#define EEPROM_ADR_PARAMSET_BEGIN   256
1967 - 26
 
1968 - 27
#define CHANNELMAP_REVISION         0
2158 - 28
#define EEPARAM_REVISION                3
29
#define EEMIXER_REVISION                1
1968 - 30
#define SENSOROFFSET_REVISION       0
2092 - 31
#define IMUCONFIG_REVISION          0
1612 dongfang 32
 
1967 - 33
void paramSet_readOrDefault(void);
34
void channelMap_readOrDefault(void);
2158 - 35
void motorMixer_readOrDefault(void);
2092 - 36
void IMUConfig_readOrDefault(void);
2159 - 37
void IMUConfig_writeToEEprom(void);
1612 dongfang 38
 
1967 - 39
uint8_t paramSet_readFromEEProm(uint8_t setnumber);
40
void paramSet_writeToEEProm(uint8_t setnumber);
1612 dongfang 41
 
1969 - 42
//uint8_t channelMap_readFromEEProm(void);
1967 - 43
void channelMap_writeToEEProm(void);
1960 - 44
 
2158 - 45
//uint8_t motorMixer_readFromEEProm(void);
46
void motorMixer_writeToEEProm(void);
1960 - 47
 
1967 - 48
uint8_t gyroAmplifierOffset_readFromEEProm(void);
49
void gyroAmplifierOffset_writeToEEProm(void);
1960 - 50
 
1967 - 51
uint8_t gyroOffset_readFromEEProm(void);
52
void gyroOffset_writeToEEProm(void);
1960 - 53
 
1967 - 54
uint8_t accOffset_readFromEEProm(void);
55
void accOffset_writeToEEProm(void);
1960 - 56
 
1967 - 57
uint8_t getParamByte(uint16_t param_id);
58
void setParamByte(uint16_t param_id, uint8_t value);
59
//uint16_t getParamWord(uint16_t param_id);
60
//void setParamWord(uint16_t param_id, uint16_t value);
1612 dongfang 61
 
1967 - 62
uint8_t getActiveParamSet(void);
63
void setActiveParamSet(uint8_t setnumber);
64
 
1612 dongfang 65
#endif //_EEPROM_H