Rev 935 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 935 | Rev 936 | ||
---|---|---|---|
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 | 5 | ||
6 | #define EEPROM_ADR_PARAM_BEGIN 0 |
6 | #define EEPROM_ADR_PARAM_BEGIN 0 |
7 | #define PID_VERSION 1 // byte |
7 | #define PID_VERSION 1 // byte |
8 | #define PID_ACTIVE_SET 2 // byte |
8 | #define PID_ACTIVE_SET 2 // byte |
9 | #define PID_PRESSURE_OFFSET 3 // byte |
9 | #define PID_PRESSURE_OFFSET 3 // byte |
10 | #define PID_ACC_NICK 4 // word |
10 | #define PID_ACC_NICK 4 // word |
11 | #define PID_ACC_ROLL 6 // word |
11 | #define PID_ACC_ROLL 6 // word |
12 | #define PID_ACC_Z 8 // word |
12 | #define PID_ACC_Z 8 // word |
13 | 13 | ||
14 | #ifdef USE_KILLAGREG |
14 | #ifdef USE_KILLAGREG |
15 | #define PID_MM3_X_OFF 10 // byte |
15 | #define PID_MM3_X_OFF 10 // byte |
16 | #define PID_MM3_Y_OFF 11 // byte |
16 | #define PID_MM3_Y_OFF 11 // byte |
17 | #define PID_MM3_Z_OFF 12 // byte |
17 | #define PID_MM3_Z_OFF 12 // byte |
18 | #define PID_MM3_X_RANGE 13 // word |
18 | #define PID_MM3_X_RANGE 13 // word |
19 | #define PID_MM3_Y_RANGE 15 // word |
19 | #define PID_MM3_Y_RANGE 15 // word |
20 | #define PID_MM3_Z_RANGE 17 // word |
20 | #define PID_MM3_Z_RANGE 17 // word |
21 | #endif |
21 | #endif |
22 | 22 | ||
23 | #define EEPROM_ADR_PARAMSET_BEGIN 100 |
23 | #define EEPROM_ADR_PARAMSET_BEGIN 100 |
24 | 24 | ||
25 | // bit mask for mk_param_struct.GlobalConfig |
25 | // bit mask for mk_param_struct.GlobalConfig |
26 | #define CFG_HEIGHT_CONTROL 0x01 |
26 | #define CFG_HEIGHT_CONTROL 0x01 |
27 | #define CFG_HEIGHT_SWITCH 0x02 |
27 | #define CFG_HEIGHT_SWITCH 0x02 |
28 | #define CFG_HEADING_HOLD 0x04 |
28 | #define CFG_HEADING_HOLD 0x04 |
29 | #define CFG_COMPASS_ACTIVE 0x08 |
29 | #define CFG_COMPASS_ACTIVE 0x08 |
30 | #define CFG_COMPASS_FIX 0x10 |
30 | #define CFG_COMPASS_FIX 0x10 |
31 | #define CFG_GPS_ACTIVE 0x20 |
31 | #define CFG_GPS_ACTIVE 0x20 |
32 | #define CFG_AXIS_COUPLING_ACTIVE 0x40 |
32 | #define CFG_AXIS_COUPLING_ACTIVE 0x40 |
33 | #define CFG_ROTARY_RATE_LIMITER 0x80 |
33 | #define CFG_ROTARY_RATE_LIMITER 0x80 |
34 | 34 | ||
35 | // bit mask for mk_param_struct.LoopConfig |
35 | // bit mask for mk_param_struct.LoopConfig |
36 | #define CFG_LOOP_UP 0x01 |
36 | #define CFG_LOOP_UP 0x01 |
37 | #define CFG_LOOP_DOWN 0x02 |
37 | #define CFG_LOOP_DOWN 0x02 |
38 | #define CFG_LOOP_LEFT 0x04 |
38 | #define CFG_LOOP_LEFT 0x04 |
39 | #define CFG_LOOP_RIGHT 0x08 |
39 | #define CFG_LOOP_RIGHT 0x08 |
40 | 40 | ||
41 | // defines for lookup mk_param_struct.ChannelAssignment |
41 | // defines for lookup mk_param_struct.ChannelAssignment |
42 | #define CH_NICK 0 |
42 | #define CH_NICK 0 |
43 | #define CH_ROLL 1 |
43 | #define CH_ROLL 1 |
44 | #define CH_GAS 2 |
44 | #define CH_GAS 2 |
45 | #define CH_YAW 3 |
45 | #define CH_YAW 3 |
46 | #define CH_POTI1 4 |
46 | #define CH_POTI1 4 |
47 | #define CH_POTI2 5 |
47 | #define CH_POTI2 5 |
48 | #define CH_POTI3 6 |
48 | #define CH_POTI3 6 |
49 | #define CH_POTI4 7 |
49 | #define CH_POTI4 7 |
50 | 50 | ||
51 | #define EEPARAM_VERSION 70 // is count up, if EE_Paramater stucture has changed (compatibility) |
51 | #define EEPARAM_VERSION 71 // is count up, if EE_Paramater stucture has changed (compatibility) |
52 | 52 | ||
53 | // values above 250 representing poti1 to poti4 |
53 | // values above 250 representing poti1 to poti4 |
54 | typedef struct |
54 | typedef struct |
55 | { |
55 | { |
56 | uint8_t ChannelAssignment[8]; // see upper defines for details |
56 | uint8_t ChannelAssignment[8]; // see upper defines for details |
57 | uint8_t GlobalConfig; // see upper defines for bitcoding |
57 | uint8_t GlobalConfig; // see upper defines for bitcoding |
58 | uint8_t Height_MinGas; // Wert : 0-100 |
58 | uint8_t Height_MinGas; // Wert : 0-100 |
59 | uint8_t Height_D; // Wert : 0-250 |
59 | uint8_t Height_D; // Wert : 0-250 |
60 | uint8_t MaxHeight; // Wert : 0-32 |
60 | uint8_t MaxHeight; // Wert : 0-32 |
61 | uint8_t Height_P; // Wert : 0-32 |
61 | uint8_t Height_P; // Wert : 0-32 |
62 | uint8_t Height_Gain; // Wert : 0-50 |
62 | uint8_t Height_Gain; // Wert : 0-50 |
63 | uint8_t Height_ACC_Effect; // Wert : 0-250 |
63 | uint8_t Height_ACC_Effect; // Wert : 0-250 |
64 | uint8_t Stick_P; // Wert : 1-6 |
64 | uint8_t Stick_P; // Wert : 1-6 |
65 | uint8_t Stick_D; // Wert : 0-64 |
65 | uint8_t Stick_D; // Wert : 0-64 |
66 | uint8_t Yaw_P; // Wert : 1-20 |
66 | uint8_t Yaw_P; // Wert : 1-20 |
67 | uint8_t Gas_Min; // Wert : 0-32 |
67 | uint8_t Gas_Min; // Wert : 0-32 |
68 | uint8_t Gas_Max; // Wert : 33-250 |
68 | uint8_t Gas_Max; // Wert : 33-250 |
69 | uint8_t GyroAccFactor; // Wert : 1-64 |
69 | uint8_t GyroAccFactor; // Wert : 1-64 |
70 | uint8_t CompassYawEffect; // Wert : 0-32 |
70 | uint8_t CompassYawEffect; // Wert : 0-32 |
71 | uint8_t Gyro_P; // Wert : 10-250 |
71 | uint8_t Gyro_P; // Wert : 10-250 |
72 | uint8_t Gyro_I; // Wert : 0-250 |
72 | uint8_t Gyro_I; // Wert : 0-250 |
73 | uint8_t LowVoltageWarning; // Wert : 0-250 |
73 | uint8_t LowVoltageWarning; // Wert : 0-250 |
74 | uint8_t EmergencyGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
74 | uint8_t EmergencyGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
75 | uint8_t EmergencyGasDuration; // Wert : 0-250 // Zeitbis auf EmergencyGas geschaltet wird, wg. Rx-Problemen |
75 | uint8_t EmergencyGasDuration; // Wert : 0-250 // Zeitbis auf EmergencyGas geschaltet wird, wg. Rx-Problemen |
76 | uint8_t UfoArrangement; // x oder + Formation |
76 | uint8_t UfoArrangement; // x oder + Formation |
77 | uint8_t I_Factor; // Wert : 0-250 |
77 | uint8_t I_Factor; // Wert : 0-250 |
78 | uint8_t UserParam1; // Wert : 0-250 |
78 | uint8_t UserParam1; // Wert : 0-250 |
79 | uint8_t UserParam2; // Wert : 0-250 |
79 | uint8_t UserParam2; // Wert : 0-250 |
80 | uint8_t UserParam3; // Wert : 0-250 |
80 | uint8_t UserParam3; // Wert : 0-250 |
81 | uint8_t UserParam4; // Wert : 0-250 |
81 | uint8_t UserParam4; // Wert : 0-250 |
82 | uint8_t ServoNickControl; // Wert : 0-250 // Stellung des Servos |
82 | uint8_t ServoNickControl; // Wert : 0-250 // Stellung des Servos |
83 | uint8_t ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
83 | uint8_t ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
84 | uint8_t ServoNickMin; // Wert : 0-250 // Anschlag |
84 | uint8_t ServoNickMin; // Wert : 0-250 // Anschlag |
85 | uint8_t ServoNickMax; // Wert : 0-250 // Anschlag |
85 | uint8_t ServoNickMax; // Wert : 0-250 // Anschlag |
86 | uint8_t ServoNickRefresh; // |
86 | uint8_t ServoNickRefresh; // |
87 | uint8_t LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
87 | uint8_t LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
88 | uint8_t LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
88 | uint8_t LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
89 | uint8_t LoopHysteresis; // Wert: 0-250 Hysterese für Stickausschlag |
89 | uint8_t LoopHysteresis; // Wert: 0-250 Hysterese für Stickausschlag |
90 | uint8_t Yaw_PosFeedback; // Wert: 0-250 Faktor, mit dem Yaw die Achsen Roll und Nick koppelt (NickRollMitkopplung) |
90 | uint8_t Yaw_PosFeedback; // Wert: 0-250 Faktor, mit dem Yaw die Achsen Roll und Nick koppelt (NickRollMitkopplung) |
91 | uint8_t Yaw_NegFeedback; // Wert: 0-250 Faktor, mit dem Yaw die Achsen Roll und Nick Gegenkoppelt (NickRollGegenkopplung) |
91 | uint8_t Yaw_NegFeedback; // Wert: 0-250 Faktor, mit dem Yaw die Achsen Roll und Nick Gegenkoppelt (NickRollGegenkopplung) |
92 | uint8_t AngleTurnOverNick; // Wert: 0-250 180°-Punkt |
92 | uint8_t AngleTurnOverNick; // Wert: 0-250 180°-Punkt |
93 | uint8_t AngleTurnOverRoll; // Wert: 0-250 180°-Punkt |
93 | uint8_t AngleTurnOverRoll; // Wert: 0-250 180°-Punkt |
94 | uint8_t GyroAccTrim; // 1/k (Koppel_ACC_Wirkung) |
94 | uint8_t GyroAccTrim; // 1/k (Koppel_ACC_Wirkung) |
95 | uint8_t DriftComp; |
95 | uint8_t DriftComp; |
96 | uint8_t DynamicStability; |
96 | uint8_t DynamicStability; |
97 | uint8_t UserParam5; // Wert : 0-250 |
97 | uint8_t UserParam5; // Wert : 0-250 |
98 | uint8_t UserParam6; // Wert : 0-250 |
98 | uint8_t UserParam6; // Wert : 0-250 |
99 | uint8_t UserParam7; // Wert : 0-250 |
99 | uint8_t UserParam7; // Wert : 0-250 |
100 | uint8_t UserParam8; // Wert : 0-250 |
100 | uint8_t UserParam8; // Wert : 0-250 |
- | 101 | uint8_t J16Bitmask; // for the J16 Output |
|
- | 102 | uint8_t J16Timing; // for the J16 Output |
|
- | 103 | uint8_t J17Bitmask; // for the J17 Output |
|
- | 104 | uint8_t J17Timing; // for the J17 Output |
|
- | 105 | uint8_t NaviGpsModeControl; // Parameters for the Naviboard |
|
- | 106 | uint8_t NaviGpsGain; |
|
- | 107 | uint8_t NaviGpsP; |
|
- | 108 | uint8_t NaviGpsI; |
|
- | 109 | uint8_t NaviGpsD; |
|
- | 110 | uint8_t NaviGpsACC; |
|
- | 111 | uint8_t NaviGpsMinSat; |
|
- | 112 | uint8_t NaviStickThreshold; |
|
- | 113 | uint8_t ExternalControl; // for serial Control |
|
101 | uint8_t LoopConfig; // see upper defines for bitcoding |
114 | uint8_t LoopConfig; // see upper defines for bitcoding |
102 | uint8_t ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
115 | uint8_t ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
103 | uint8_t Reserved[4]; |
116 | uint8_t Reserved[4]; |
104 | int8_t Name[12]; |
117 | int8_t Name[12]; |
105 | } paramset_t; |
118 | } paramset_t; |
106 | 119 | ||
107 | #define PARAMSET_STRUCT_LEN sizeof(paramset_t) |
120 | #define PARAMSET_STRUCT_LEN sizeof(paramset_t) |
108 | 121 | ||
109 | extern paramset_t ParamSet; |
122 | extern paramset_t ParamSet; |
110 | 123 | ||
111 | extern void ParamSet_Init(void); |
124 | extern void ParamSet_Init(void); |
112 | extern void ParamSet_ReadFromEEProm(uint8_t setnumber); |
125 | extern void ParamSet_ReadFromEEProm(uint8_t setnumber); |
113 | extern void ParamSet_WriteToEEProm(uint8_t setnumber); |
126 | extern void ParamSet_WriteToEEProm(uint8_t setnumber); |
114 | extern uint8_t GetActiveParamSet(void); |
127 | extern uint8_t GetActiveParamSet(void); |
115 | extern void SetActiveParamSet(uint8_t setnumber); |
128 | extern void SetActiveParamSet(uint8_t setnumber); |
116 | 129 | ||
117 | 130 | ||
118 | extern uint8_t GetParamByte(uint8_t param_id); |
131 | extern uint8_t GetParamByte(uint8_t param_id); |
119 | extern void SetParamByte(uint8_t param_id, uint8_t value); |
132 | extern void SetParamByte(uint8_t param_id, uint8_t value); |
120 | extern uint16_t GetParamWord(uint8_t param_id); |
133 | extern uint16_t GetParamWord(uint8_t param_id); |
121 | extern void SetParamWord(uint8_t param_id, uint16_t value); |
134 | extern void SetParamWord(uint8_t param_id, uint16_t value); |
122 | 135 | ||
123 | #endif //_EEPROM_H |
136 | #endif //_EEPROM_H |
124 | 137 |