Rev 750 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 750 | Rev 801 | ||
---|---|---|---|
1 | /*************************************************************************** |
1 | /*************************************************************************** |
2 | * Copyright (C) 2009 by Manuel Schrape * |
2 | * Copyright (C) 2009 by Manuel Schrape * |
3 | * manuel.schrape@gmx.de * |
3 | * manuel.schrape@gmx.de * |
4 | * * |
4 | * * |
5 | * This program is free software; you can redistribute it and/or modify * |
5 | * This program is free software; you can redistribute it and/or modify * |
6 | * it under the terms of the GNU General Public License as published by * |
6 | * it under the terms of the GNU General Public License as published by * |
7 | * the Free Software Foundation; either version 2 of the License. * |
7 | * the Free Software Foundation; either version 2 of the License. * |
8 | * * |
8 | * * |
9 | * This program is distributed in the hope that it will be useful, * |
9 | * This program is distributed in the hope that it will be useful, * |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
12 | * GNU General Public License for more details. * |
12 | * GNU General Public License for more details. * |
13 | * * |
13 | * * |
14 | * You should have received a copy of the GNU General Public License * |
14 | * You should have received a copy of the GNU General Public License * |
15 | * along with this program; if not, write to the * |
15 | * along with this program; if not, write to the * |
16 | * Free Software Foundation, Inc., * |
16 | * Free Software Foundation, Inc., * |
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
18 | ***************************************************************************/ |
18 | ***************************************************************************/ |
19 | #ifndef MK_DATATYPES_H |
19 | #ifndef MK_DATATYPES_H |
20 | #define MK_DATATYPES_H |
20 | #define MK_DATATYPES_H |
21 | 21 | ||
22 | #include <stdint.h> |
22 | #include <stdint.h> |
23 | 23 | ||
24 | #ifdef _BETA_ |
24 | #ifdef _BETA_ |
25 | static const int MK_VERSION_SETTINGS = 82; // wird angepasst, wenn sich die EEPROM-Daten ge�ndert haben |
25 | static const int MK_VERSION_SETTINGS = 84; // wird angepasst, wenn sich die EEPROM-Daten ge�ndert haben |
26 | #else |
26 | #else |
27 | static const int MK_VERSION_SETTINGS = 82; // wird angepasst, wenn sich die EEPROM-Daten ge�ndert haben |
27 | static const int MK_VERSION_SETTINGS = 84; // wird angepasst, wenn sich die EEPROM-Daten ge�ndert haben |
28 | #endif |
28 | #endif |
29 | 29 | ||
30 | static const int MK_VERSION_NAVI = 3; // wird angepasst, wenn sich die Navi-Daten ge�ndert haben |
30 | static const int MK_VERSION_NAVI = 4; // wird angepasst, wenn sich die Navi-Daten ge�ndert haben |
31 | 31 | ||
32 | static const int MK_VERSION_MIXER = 1; // wird angepasst, wenn sich die Mixer-Daten ge�ndert haben |
32 | static const int MK_VERSION_MIXER = 1; // wird angepasst, wenn sich die Mixer-Daten ge�ndert haben |
33 | static const int MK_MAX_MOTOR = 16; // Maximale Anzahl der Motoren im Mixer |
33 | static const int MK_MAX_MOTOR = 16; // Maximale Anzahl der Motoren im Mixer |
34 | 34 | ||
35 | // Version des Seriellen Protokoll |
35 | // Version des Seriellen Protokoll |
36 | static const int VERSION_SERIAL_MAJOR = 11; |
36 | static const int VERSION_SERIAL_MAJOR = 11; |
37 | static const int VERSION_SERIAL_MINOR = 0; |
37 | static const int VERSION_SERIAL_MINOR = 0; |
38 | 38 | ||
39 | // Basis-Addressen der verschiedenen Hardware |
39 | // Basis-Addressen der verschiedenen Hardware |
40 | static const int ADDRESS_ALL = 0; |
40 | static const int ADDRESS_ALL = 0; |
41 | static const int ADDRESS_FC = 1; |
41 | static const int ADDRESS_FC = 1; |
42 | static const int ADDRESS_NC = 2; |
42 | static const int ADDRESS_NC = 2; |
43 | static const int ADDRESS_MK3MAG = 3; |
43 | static const int ADDRESS_MK3MAG = 3; |
- | 44 | static const int ADDRESS_BLC = 5; |
|
44 | 45 | ||
45 | #define FLAG_MOTOR_RUN 1 |
46 | #define FCFLAG_MOTOR_RUN 0x01 |
46 | #define FLAG_FLY 2 |
47 | #define FCFLAG_FLY 0x02 |
47 | #define FLAG_CALIBRATE 4 |
48 | #define FCFLAG_CALIBRATE 0x04 |
48 | #define FLAG_START 8 |
49 | #define FCFLAG_START 0x08 |
49 | #define FLAG_NOTLANDUNG 16 |
50 | #define FCFLAG_NOTLANDUNG 0x10 |
- | 51 | #define FCFLAG_LOWBAT 0x20 |
|
- | 52 | #define FCFLAG_SPI_RX_ERR 0x40 |
|
- | 53 | #define FCFLAG_I2CERR 0x80 |
|
- | 54 | ||
- | 55 | #define DEFEKT_G_NICK 0x01 |
|
- | 56 | #define DEFEKT_G_ROLL 0x02 |
|
- | 57 | #define DEFEKT_G_GIER 0x04 |
|
- | 58 | #define DEFEKT_A_NICK 0x08 |
|
- | 59 | #define DEFEKT_A_ROLL 0x10 |
|
- | 60 | #define DEFEKT_A_Z 0x20 |
|
- | 61 | #define DEFEKT_PRESSURE 0x40 |
|
- | 62 | #define DEFEKT_CAREFREE_ERR 0x80 |
|
- | 63 | ||
- | 64 | #define DEFEKT_I2C 0x01 |
|
- | 65 | #define DEFEKT_BL_MISSING 0x02 |
|
- | 66 | #define DEFEKT_SPI_RX_ERR 0x04 |
|
- | 67 | #define DEFEKT_PPM_ERR 0x08 |
|
50 | #define FLAG_LOWBAT 32 |
68 | #define DEFEKT_MIXER_ERR 0x10 |
51 | 69 | ||
52 | #define CFG_HOEHENREGELUNG 0x01 |
70 | #define CFG_HOEHENREGELUNG 0x01 |
53 | #define CFG_HOEHEN_SCHALTER 0x02 |
71 | #define CFG_HOEHEN_SCHALTER 0x02 |
54 | #define CFG_HEADING_HOLD 0x04 |
72 | #define CFG_HEADING_HOLD 0x04 |
55 | #define CFG_KOMPASS_AKTIV 0x08 |
73 | #define CFG_KOMPASS_AKTIV 0x08 |
56 | #define CFG_KOMPASS_FIX 0x10 |
74 | #define CFG_KOMPASS_FIX 0x10 |
57 | #define CFG_GPS_AKTIV 0x20 |
75 | #define CFG_GPS_AKTIV 0x20 |
58 | #define CFG_ACHSENKOPPLUNG_AKTIV 0x40 |
76 | #define CFG_ACHSENKOPPLUNG_AKTIV 0x40 |
59 | #define CFG_DREHRATEN_BEGRENZER 0x80 |
77 | #define CFG_DREHRATEN_BEGRENZER 0x80 |
60 | 78 | ||
61 | #define CFG_LOOP_OBEN 0x01 |
79 | #define CFG_LOOP_OBEN 0x01 |
62 | #define CFG_LOOP_UNTEN 0x02 |
80 | #define CFG_LOOP_UNTEN 0x02 |
63 | #define CFG_LOOP_LINKS 0x04 |
81 | #define CFG_LOOP_LINKS 0x04 |
64 | #define CFG_LOOP_RECHTS 0x08 |
82 | #define CFG_LOOP_RECHTS 0x08 |
65 | #define CFG_MOTOR_BLINK 0x10 |
83 | #define CFG_MOTOR_BLINK 0x10 |
66 | #define CFG_MOTOR_OFF_LED1 0x20 |
84 | #define CFG_MOTOR_OFF_LED1 0x20 |
67 | #define CFG_MOTOR_OFF_LED2 0x40 |
85 | #define CFG_MOTOR_OFF_LED2 0x40 |
68 | #define CFG_RES4 0x80 |
86 | #define CFG_RES4 0x80 |
69 | 87 | ||
70 | #define CFG2_HEIGHT_LIMIT 0x01 |
88 | #define CFG2_HEIGHT_LIMIT 0x01 |
71 | #define CFG2_VARIO_BEEP 0x02 |
89 | #define CFG2_VARIO_BEEP 0x02 |
72 | #define CFG_SENSITIVE_RC 0x04 |
90 | #define CFG_SENSITIVE_RC 0x04 |
- | 91 | ||
- | 92 | #define CFG0_AIRPRESS_SENSOR 0x01 |
|
- | 93 | #define CFG0_HEIGHT_SWITCH 0x02 |
|
- | 94 | #define CFG0_HEADING_HOLD 0x04 |
|
- | 95 | #define CFG0_COMPASS_ACTIVE 0x08 |
|
- | 96 | #define CFG0_COMPASS_FIX 0x10 |
|
- | 97 | #define CFG0_GPS_ACTIVE 0x20 |
|
- | 98 | #define CFG0_AXIS_COUPLING_ACTIVE 0x40 |
|
- | 99 | #define CFG0_ROTARY_RATE_LIMITER 0x80 |
|
- | 100 | ||
- | 101 | // defines for the receiver selection |
|
- | 102 | #define RECEIVER_PPM 0 |
|
- | 103 | #define RECEIVER_SPEKTRUM 1 |
|
- | 104 | #define RECEIVER_SPEKTRUM_HI_RES 2 |
|
- | 105 | #define RECEIVER_SPEKTRUM_LOW_RES 3 |
|
- | 106 | #define RECEIVER_JETI 4 |
|
- | 107 | #define RECEIVER_ACT_DSL 5 |
|
- | 108 | #define RECEIVER_UNKNOWN 0xFF |
|
- | 109 | ||
- | 110 | struct s_MK_VersionInfo |
|
- | 111 | { |
|
- | 112 | unsigned char SWMajor; |
|
- | 113 | unsigned char SWMinor; |
|
- | 114 | unsigned char ProtoMajor; |
|
- | 115 | unsigned char ProtoMinor; |
|
- | 116 | unsigned char SWPatch; |
|
- | 117 | unsigned char HardwareError[5]; |
|
- | 118 | }; |
|
73 | 119 | ||
74 | struct s_MK_Debug |
120 | struct s_MK_Debug |
75 | { |
121 | { |
76 | unsigned char Digital[2]; |
122 | unsigned char Digital[2]; |
77 | int16_t Analog[32]; // Debugwerte |
123 | int16_t Analog[32]; // Debugwerte |
78 | }; |
124 | }; |
79 | 125 | ||
80 | struct s_MK_DebugLabels |
126 | struct s_MK_DebugLabels |
81 | { |
127 | { |
82 | int Position; |
128 | int Position; |
83 | QString Text; |
129 | QString Text; |
84 | }; |
130 | }; |
85 | 131 | ||
86 | //typedef int16_t s_MK_PPM_Data[26]; |
132 | //typedef int16_t s_MK_PPM_Data[26]; |
87 | 133 | ||
88 | struct s_MK_PPM_Data |
134 | struct s_MK_PPM_Data |
89 | { |
135 | { |
90 | int16_t Data[26]; |
136 | int16_t Data[26]; |
91 | }; |
137 | }; |
92 | 138 | ||
93 | 139 | ||
94 | struct s_MK_Settings |
140 | struct s_MK_Settings |
95 | { |
141 | { |
96 | // Die ersten beiden Bytes nicht an den MK senden. |
142 | // Die ersten beiden Bytes nicht an den MK senden. |
97 | unsigned char Index; |
143 | unsigned char Index; |
98 | unsigned char Version; |
- | |
- | 144 | ||
99 | 145 | unsigned char Revision; |
|
100 | unsigned char Kanalbelegung[12]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
146 | unsigned char Kanalbelegung[12]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
101 | unsigned char GlobalConfig; // 0x01=H�henregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
147 | unsigned char GlobalConfig; // 0x01=H�henregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
102 | unsigned char Hoehe_MinGas; // Wert : 0-100 |
148 | unsigned char Hoehe_MinGas; // Wert : 0-100 |
103 | unsigned char Luftdruck_D; // Wert : 0-250 |
149 | unsigned char Luftdruck_D; // Wert : 0-250 |
104 | unsigned char MaxHoehe; // Wert : 0-32 |
150 | unsigned char MaxHoehe; // Wert : 0-32 |
105 | unsigned char Hoehe_P; // Wert : 0-32 |
151 | unsigned char Hoehe_P; // Wert : 0-32 |
106 | unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
152 | unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
107 | unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
153 | unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
108 | unsigned char Hoehe_HoverBand; // Wert : 0-250 |
154 | unsigned char Hoehe_HoverBand; // Wert : 0-250 |
109 | unsigned char Hoehe_GPS_Z; // Wert : 0-250 |
155 | unsigned char Hoehe_GPS_Z; // Wert : 0-250 |
110 | unsigned char Hoehe_StickNeutralPoint;// Wert : 0-250 |
156 | unsigned char Hoehe_StickNeutralPoint;// Wert : 0-250 |
111 | unsigned char Stick_P; // Wert : 1-6 |
157 | unsigned char Stick_P; // Wert : 1-6 |
112 | unsigned char Stick_D; // Wert : 0-64 |
158 | unsigned char Stick_D; // Wert : 0-64 |
113 | unsigned char Gier_P; // Wert : 1-20 |
159 | unsigned char Gier_P; // Wert : 1-20 |
114 | unsigned char Gas_Min; // Wert : 0-32 |
160 | unsigned char Gas_Min; // Wert : 0-32 |
115 | unsigned char Gas_Max; // Wert : 33-250 |
161 | unsigned char Gas_Max; // Wert : 33-250 |
116 | unsigned char GyroAccFaktor; // Wert : 1-64 |
162 | unsigned char GyroAccFaktor; // Wert : 1-64 |
117 | unsigned char KompassWirkung; // Wert : 0-32 |
163 | unsigned char KompassWirkung; // Wert : 0-32 |
118 | unsigned char Gyro_P; // Wert : 10-250 |
164 | unsigned char Gyro_P; // Wert : 10-250 |
119 | unsigned char Gyro_I; // Wert : 0-250 |
165 | unsigned char Gyro_I; // Wert : 0-250 |
120 | unsigned char Gyro_D; // Wert : 0-250 |
166 | unsigned char Gyro_D; // Wert : 0-250 |
121 | unsigned char Gyro_Gier_P; // Wert : 10-250 |
167 | unsigned char Gyro_Gier_P; // Wert : 10-250 |
122 | unsigned char Gyro_Gier_I; // Wert : 0-250 |
168 | unsigned char Gyro_Gier_I; // Wert : 0-250 |
- | 169 | unsigned char Gyro_Stability; // 0.80 Wert : 0-16 |
|
123 | unsigned char UnterspannungsWarnung; // Wert : 0-250 |
170 | unsigned char UnterspannungsWarnung; // Wert : 0-250 |
124 | unsigned char NotGas; // Wert : 0-250 //Gaswert bei Emp�ngsverlust |
171 | unsigned char NotGas; // Wert : 0-250 //Gaswert bei Emp�ngsverlust |
125 | unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
172 | unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
126 | unsigned char Receiver; // 0= Summensignal, 1= Spektrum, 2 =Jeti, 3=ACT DSL, 4=ACT S3D |
173 | unsigned char Receiver; // 0= Summensignal, 1= Spektrum, 2 =Jeti, 3=ACT DSL, 4=ACT S3D |
127 | unsigned char I_Faktor; // Wert : 0-250 |
174 | unsigned char I_Faktor; // Wert : 0-250 |
128 | unsigned char UserParam1; // Wert : 0-250 |
175 | unsigned char UserParam1; // Wert : 0-250 |
129 | unsigned char UserParam2; // Wert : 0-250 |
176 | unsigned char UserParam2; // Wert : 0-250 |
130 | unsigned char UserParam3; // Wert : 0-250 |
177 | unsigned char UserParam3; // Wert : 0-250 |
131 | unsigned char UserParam4; // Wert : 0-250 |
178 | unsigned char UserParam4; // Wert : 0-250 |
132 | unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
179 | unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
133 | unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
180 | unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
134 | unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
181 | unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
135 | unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
182 | unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
136 | //--- Seit V0.75 |
- | |
137 | unsigned char ServoRollControl; // Wert : 0-250 // Stellung des Servos |
183 | unsigned char ServoRollControl; // 0.75 Wert : 0-250 // Stellung des Servos |
138 | unsigned char ServoRollComp; // Wert : 0-250 |
184 | unsigned char ServoRollComp; // 0.75 Wert : 0-250 |
139 | unsigned char ServoRollMin; // Wert : 0-250 |
185 | unsigned char ServoRollMin; // 0.75 Wert : 0-250 |
140 | unsigned char ServoRollMax; // Wert : 0-250 |
186 | unsigned char ServoRollMax; // 0.75 Wert : 0-250 |
141 | //--- |
- | |
142 | unsigned char ServoNickRefresh; // Speed of the Servo |
187 | unsigned char ServoNickRefresh; // Speed of the Servo |
143 | unsigned char Servo3; // Value or mapping of the Servo Output |
188 | unsigned char Servo3; // Value or mapping of the Servo Output |
144 | unsigned char Servo4; // Value or mapping of the Servo Output |
189 | unsigned char Servo4; // Value or mapping of the Servo Output |
145 | unsigned char Servo5; // Value or mapping of the Servo Output |
190 | unsigned char Servo5; // Value or mapping of the Servo Output |
146 | unsigned char LoopGasLimit; // Wert: 0-250 max. Gas w�hrend Looping |
191 | unsigned char LoopGasLimit; // Wert: 0-250 max. Gas w�hrend Looping |
147 | unsigned char LoopThreshold; // Wert: 0-250 Schwelle f�r Stickausschlag |
192 | unsigned char LoopThreshold; // Wert: 0-250 Schwelle f�r Stickausschlag |
148 | unsigned char LoopHysterese; // Wert: 0-250 Hysterese f�r Stickausschlag |
193 | unsigned char LoopHysterese; // Wert: 0-250 Hysterese f�r Stickausschlag |
149 | unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung) |
194 | unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung) |
150 | unsigned char AchsKopplung2; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden |
195 | unsigned char AchsKopplung2; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden |
151 | unsigned char CouplingYawCorrection; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden |
196 | unsigned char CouplingYawCorrection; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden |
152 | unsigned char WinkelUmschlagNick; // Wert: 0-250 180�-Punkt |
197 | unsigned char WinkelUmschlagNick; // Wert: 0-250 180�-Punkt |
153 | unsigned char WinkelUmschlagRoll; // Wert: 0-250 180�-Punkt |
198 | unsigned char WinkelUmschlagRoll; // Wert: 0-250 180�-Punkt |
154 | unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung) |
199 | unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung) |
155 | unsigned char Driftkomp; |
200 | unsigned char Driftkomp; // |
156 | unsigned char DynamicStability; |
201 | unsigned char DynamicStability; // |
157 | unsigned char UserParam5; // Wert : 0-250 |
202 | unsigned char UserParam5; // Wert : 0-250 |
158 | unsigned char UserParam6; // Wert : 0-250 |
203 | unsigned char UserParam6; // Wert : 0-250 |
159 | unsigned char UserParam7; // Wert : 0-250 |
204 | unsigned char UserParam7; // Wert : 0-250 |
160 | unsigned char UserParam8; // Wert : 0-250 |
205 | unsigned char UserParam8; // Wert : 0-250 |
161 | //---Output --------------------------------------------- |
206 | //---Output --------------------------------------------- |
162 | unsigned char J16Bitmask; // for the J16 Output |
207 | unsigned char J16Bitmask; // for the J16 Output |
163 | unsigned char J16Timing; // for the J16 Output |
208 | unsigned char J16Timing; // for the J16 Output |
164 | unsigned char J17Bitmask; // for the J17 Output |
209 | unsigned char J17Bitmask; // for the J17 Output |
165 | unsigned char J17Timing; // for the J17 Output |
210 | unsigned char J17Timing; // for the J17 Output |
166 | // seit version V0.75c |
- | |
167 | unsigned char WARN_J16_Bitmask; // for the J16 Output |
211 | unsigned char WARN_J16_Bitmask; // 0.75 for the J16 Output |
168 | unsigned char WARN_J17_Bitmask; // for the J17 Output |
212 | unsigned char WARN_J17_Bitmask; // 0.75 for the J17 Output |
169 | //---NaviCtrl--------------------------------------------- |
213 | //---NaviCtrl--------------------------------------------- |
170 | unsigned char NaviGpsModeControl; // Parameters for the Naviboard |
214 | unsigned char NaviGpsModeControl; // Parameters for the Naviboard |
171 | unsigned char NaviGpsGain; |
215 | unsigned char NaviGpsGain; |
172 | unsigned char NaviGpsP; |
216 | unsigned char NaviGpsP; |
173 | unsigned char NaviGpsI; |
217 | unsigned char NaviGpsI; |
174 | unsigned char NaviGpsD; |
218 | unsigned char NaviGpsD; |
175 | unsigned char NaviGpsPLimit; |
219 | unsigned char NaviGpsPLimit; |
176 | unsigned char NaviGpsILimit; |
220 | unsigned char NaviGpsILimit; |
177 | unsigned char NaviGpsDLimit; |
221 | unsigned char NaviGpsDLimit; |
178 | unsigned char NaviGpsACC; |
222 | unsigned char NaviGpsACC; |
179 | unsigned char NaviGpsMinSat; |
223 | unsigned char NaviGpsMinSat; |
180 | unsigned char NaviStickThreshold; |
224 | unsigned char NaviStickThreshold; |
181 | unsigned char NaviWindCorrection; |
225 | unsigned char NaviWindCorrection; |
182 | unsigned char NaviSpeedCompensation; |
226 | unsigned char NaviSpeedCompensation; |
183 | unsigned char NaviOperatingRadius; |
227 | unsigned char NaviOperatingRadius; |
184 | unsigned char NaviAngleLimitation; |
228 | unsigned char NaviAngleLimitation; |
185 | unsigned char NaviPH_LoginTime; |
229 | unsigned char NaviPH_LoginTime; |
186 | //---Ext.Ctrl--------------------------------------------- |
230 | //---Ext.Ctrl--------------------------------------------- |
187 | unsigned char ExternalControl; // for serial Control |
231 | unsigned char ExternalControl; // for serial Control |
188 | //------------------------------------------------ |
232 | //---CareFree--------------------------------------------- |
- | 233 | unsigned char OrientationAngle; // 0.80 Where is the front-direction? |
|
- | 234 | unsigned char OrientationModeControl; // 0.80 switch for CareFree |
|
- | 235 | //-------------------------------------------------------- |
|
189 | unsigned char BitConfig; // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
236 | unsigned char BitConfig; // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
190 | unsigned char ServoCompInvert; // // 0x01 = Nick, 0x02 = Roll 0 oder 1 // WICHTIG!!! am Ende lassen |
237 | unsigned char ServoCompInvert; // // 0x01 = Nick, 0x02 = Roll 0 oder 1 // WICHTIG!!! am Ende lassen |
191 | unsigned char ExtraConfig; // bitcodiert |
238 | unsigned char ExtraConfig; // bitcodiert |
192 | char Name[12]; |
239 | char Name[12]; |
- | 240 | unsigned char crc; |
|
193 | 241 | ||
194 | }; |
242 | }; |
195 | 243 | ||
196 | struct s_MK_Mixer |
244 | struct s_MK_Mixer |
197 | { |
245 | { |
198 | char Revision; |
246 | uint8_t Revision; |
199 | char Name[12]; |
247 | char Name[12]; |
200 | signed char Motor[16][4]; |
248 | int8_t Motor[16][4]; |
- | 249 | uint8_t crc; |
|
201 | }; |
250 | }; |
202 | 251 | ||
203 | /////////////// |
252 | /////////////// |
204 | // Navi-Ctrl // |
253 | // Navi-Ctrl // |
205 | /////////////// |
254 | /////////////// |
206 | 255 | ||
207 | #define INVALID 0x00 |
256 | #define INVALID 0x00 |
208 | #define NEWDATA 0x01 |
257 | #define NEWDATA 0x01 |
209 | #define PROCESSED 0x02 |
258 | #define PROCESSED 0x02 |
210 | 259 | ||
211 | #define NC_FLAG_FREE 0x01 |
260 | #define NC_FLAG_FREE 0x01 |
212 | #define NC_FLAG_PH 0x02 |
261 | #define NC_FLAG_PH 0x02 |
213 | #define NC_FLAG_CH 0x04 |
262 | #define NC_FLAG_CH 0x04 |
214 | #define NC_FLAG_RANGE_LIMIT 0x08 |
263 | #define NC_FLAG_RANGE_LIMIT 0x08 |
215 | #define NC_FLAG_NOSERIALLINK 0x10 |
264 | #define NC_FLAG_NOSERIALLINK 0x10 |
216 | #define NC_FLAG_TARGET_REACHED 0x20 |
265 | #define NC_FLAG_TARGET_REACHED 0x20 |
217 | #define NC_FLAG_MANUAL_CONTROL 0x40 |
266 | #define NC_FLAG_MANUAL_CONTROL 0x40 |
218 | #define NC_FLAG_8 0x80 |
267 | #define NC_FLAG_8 0x80 |
- | 268 | ||
- | 269 | #define POINT_TYPE_WP 0 |
|
- | 270 | #define POINT_TYPE_POI 1 |
|
219 | 271 | ||
220 | typedef struct |
272 | typedef struct |
221 | { |
273 | { |
222 | int32_t Longitude; // in 1E-7 deg |
274 | int32_t Longitude; // in 1E-7 deg |
223 | int32_t Latitude; // in 1E-7 deg |
275 | int32_t Latitude; // in 1E-7 deg |
224 | int32_t Altitude; // in mm |
276 | int32_t Altitude; // in mm |
225 | uint8_t Status; // validity of data |
277 | uint8_t Status; // validity of data |
226 | } __attribute__((packed)) GPS_Pos_t; |
278 | } __attribute__((packed)) GPS_Pos_t; |
227 | 279 | ||
228 | typedef struct |
280 | typedef struct |
229 | { |
281 | { |
230 | uint16_t Distance; // distance to target in dm |
282 | uint16_t Distance; // distance to target in dm |
231 | int16_t Bearing; // course to target in deg |
283 | int16_t Bearing; // course to target in deg |
232 | } __attribute__((packed)) GPS_PosDev_t; |
284 | } __attribute__((packed)) GPS_PosDev_t; |
233 | 285 | ||
234 | typedef struct |
286 | typedef struct |
235 | { |
287 | { |
236 | uint8_t Version; // version of the data structure |
288 | uint8_t Version; // version of the data structure |
237 | GPS_Pos_t CurrentPosition; // see ubx.h for details |
289 | GPS_Pos_t CurrentPosition; // see ubx.h for details |
238 | GPS_Pos_t TargetPosition; |
290 | GPS_Pos_t TargetPosition; |
239 | GPS_PosDev_t TargetPositionDeviation; |
291 | GPS_PosDev_t TargetPositionDeviation; |
240 | GPS_Pos_t HomePosition; |
292 | GPS_Pos_t HomePosition; |
241 | GPS_PosDev_t HomePositionDeviation; |
293 | GPS_PosDev_t HomePositionDeviation; |
242 | uint8_t WaypointIndex; // index of current waypoints running from 0 to WaypointNumber-1 |
294 | uint8_t WaypointIndex; // index of current waypoints running from 0 to WaypointNumber-1 |
243 | uint8_t WaypointNumber; // number of stored waypoints |
295 | uint8_t WaypointNumber; // number of stored waypoints |
244 | uint8_t SatsInUse; // number of satellites used for position solution |
296 | uint8_t SatsInUse; // number of satellites used for position solution |
245 | int16_t Altimeter; // hight according to air pressure |
297 | int16_t Altimeter; // hight according to air pressure |
246 | int16_t Variometer; // climb(+) and sink(-) rate |
298 | int16_t Variometer; // climb(+) and sink(-) rate |
247 | uint16_t FlyingTime; // in seconds |
299 | uint16_t FlyingTime; // in seconds |
248 | uint8_t UBat; // Battery Voltage in 0.1 Volts |
300 | uint8_t UBat; // Battery Voltage in 0.1 Volts |
249 | uint16_t GroundSpeed; // speed over ground in cm/s (2D) |
301 | uint16_t GroundSpeed; // speed over ground in cm/s (2D) |
250 | int16_t Heading; // current flight direction in ° as angle to north |
302 | int16_t Heading; // current flight direction in ° as angle to north |
251 | int16_t CompassHeading; // current compass value in ° |
303 | int16_t CompassHeading; // current compass value in ° |
252 | int8_t AngleNick; // current Nick angle in 1° |
304 | int8_t AngleNick; // current Nick angle in 1° |
253 | int8_t AngleRoll; // current Rick angle in 1° |
305 | int8_t AngleRoll; // current Rick angle in 1° |
254 | uint8_t RC_Quality; // RC_Quality |
306 | uint8_t RC_Quality; // RC_Quality |
255 | uint8_t MKFlags; // Flags from FC |
307 | uint8_t FCFlags; // Flags from FC |
256 | uint8_t NCFlags; // Flags from NC |
308 | uint8_t NCFlags; // Flags from NC |
257 | uint8_t Errorcode; // 0 --> okay |
309 | uint8_t Errorcode; // 0 --> okay |
258 | uint8_t OperatingRadius; // current operation radius around the Home Position in m |
310 | uint8_t OperatingRadius; // current operation radius around the Home Position in m |
259 | int16_t TopSpeed; // velocity in vertical direction in cm/s |
311 | int16_t TopSpeed; // velocity in vertical direction in cm/s |
260 | uint8_t TargetHoldTime; // time in s to stay at the given target, counts down to 0 if target has been reached |
312 | uint8_t TargetHoldTime; // time in s to stay at the given target, counts down to 0 if target has been reached |
261 | uint8_t RC_RSSI; // Receiver signal strength (since version 2 added) |
313 | uint8_t RC_RSSI; // Receiver signal strength (since version 2 added) |
262 | int16_t SetpointAltitude; // setpoint for altitude |
314 | int16_t SetpointAltitude; // setpoint for altitude |
263 | uint8_t Gas; // for future use |
315 | uint8_t Gas; // for future use |
264 | uint16_t Current; // actual current in 0.1A steps |
316 | uint16_t Current; // actual current in 0.1A steps |
265 | uint16_t UsedCapacity; // used capacity in mAh |
317 | uint16_t UsedCapacity; // used capacity in mAh |
266 | 318 | ||
267 | } __attribute__((packed)) s_MK_NaviData; |
319 | } __attribute__((packed)) s_MK_NaviData; |
268 | 320 | ||
269 | typedef struct |
321 | typedef struct |
270 | { |
322 | { |
271 | GPS_Pos_t Position; // the gps position of the waypoint, see ubx.h for details |
323 | GPS_Pos_t Position; // the gps position of the waypoint, see ubx.h for details |
272 | int16_t Heading; // orientation, future implementation |
324 | int16_t Heading; // orientation, future implementation |
273 | uint8_t ToleranceRadius; // in meters, if the MK is within that range around the target, then the next target is triggered |
325 | uint8_t ToleranceRadius; // in meters, if the MK is within that range around the target, then the next target is triggered |
274 | uint8_t HoldTime; // in seconds, if the was once in the tolerance area around a WP, this time defies the delay before the next WP is triggered |
326 | uint8_t HoldTime; // in seconds, if the was once in the tolerance area around a WP, this time defies the delay before the next WP is triggered |
275 | uint8_t Event_Flag; // future emplementation |
327 | uint8_t Event_Flag; // future emplementation |
- | 328 | uint8_t Index; // to indentify different waypoints, workaround for bad communications PC <-> NC |
|
- | 329 | uint8_t Type; // type of Waypoint |
|
276 | uint8_t reserve[12]; // reserve |
330 | uint8_t reserve[11]; // reserve |
277 | } __attribute__((packed)) s_MK_WayPoint; |
331 | } __attribute__((packed)) s_MK_WayPoint; |
278 | 332 | ||
279 | #endif // MK_DATATYPES_H |
333 | #endif // MK_DATATYPES_H |
280 | 334 |