Subversion Repositories FlightCtrl

Rev

Rev 1964 | Rev 1968 | 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
1960 - 9
 
1965 - 10
#define PID_ACTIVE_SET          0   // byte
11
#define EEPROM_ADR_ACCOFFSET    1
12
#define EEPROM_ADR_GYROOFFSET   (EEPROM_ADR_ACCOFFSET+sizeof(sensorOffset_t)+2)
13
#define EEPROM_ADR_DACVALUES    (EEPROM_ADR_GYROOFFSET+sizeof(sensorOffset_t)+2)
14
#define EEPROM_ADR_CHANNELMAP   (EEPROM_ADR_GYROOFFSET+sizeof(sensorOffset_t)+2)
15
#define EEPROM_ADR_MIXER_TABLE  (EEPROM_ADR_CHANNELMAP+sizeof(channelMap_t)+2)
16
#define EEPROM_ADR_PARAMSET_BEGIN (EEPROM_ADR_CHANNELMAP+sizeof(mixerMatrix_t)+2)
1960 - 17
 
18
#define CHANNELMAP_REVISION     0
1965 - 19
#define EEPARAM_REVISION            0
20
#define EEMIXER_REVISION            0
1960 - 21
#define SENSOROFFSET_REVISION   0
1612 dongfang 22
 
1960 - 23
extern void paramSet_readOrDefault(void);
24
extern void channelMap_readOrDefault(void);
25
extern void mixerMatrix_readOrDefault(void);
1612 dongfang 26
 
1960 - 27
extern uint8_t paramSet_readFromEEProm(uint8_t setnumber);
28
extern void paramSet_writeToEEProm(uint8_t setnumber);
1612 dongfang 29
 
1960 - 30
extern uint8_t channelMap_readFromEEProm(void);
31
extern void channelMap_writeToEEProm(void);
32
 
33
extern uint8_t mixerMatrix_eeadFromEEProm(void);
34
extern void mixerMatrix_writeToEEProm(void);
35
 
36
extern uint8_t accOffset_readFromEEProm(void);
37
extern void accOffset_writeToEEProm(void);
38
 
39
extern uint8_t gyroOffset_readFromEEProm(void);
40
extern void gyroOffset_writeToEEProm(void);
41
 
42
extern uint8_t getParamByte(uint16_t param_id);
43
extern void setParamByte(uint16_t param_id, uint8_t value);
44
extern uint16_t getParamWord(uint16_t param_id);
45
extern void setParamWord(uint16_t param_id, uint16_t value);
46
 
1612 dongfang 47
extern uint8_t getActiveParamSet(void);
48
extern void setActiveParamSet(uint8_t setnumber);
49
 
50
#endif //_EEPROM_H