Subversion Repositories Projects

Rev

Rev 674 | Rev 801 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 674 Rev 750
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 = 80; // wird angepasst, wenn sich die EEPROM-Daten ge�ndert haben
25
    static const int MK_VERSION_SETTINGS = 82; // wird angepasst, wenn sich die EEPROM-Daten ge�ndert haben
26
#else
26
#else
27
    static const int MK_VERSION_SETTINGS = 80; // wird angepasst, wenn sich die EEPROM-Daten ge�ndert haben
27
    static const int MK_VERSION_SETTINGS = 82; // wird angepasst, wenn sich die EEPROM-Daten ge�ndert haben
28
#endif
28
#endif
29
 
29
 
30
static const int MK_VERSION_NAVI     =  2; // wird angepasst, wenn sich die Mixer-Daten ge�ndert haben
30
static const int MK_VERSION_NAVI     =  3; // 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 = 10;
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
 
44
 
45
#define FLAG_MOTOR_RUN  1
45
#define FLAG_MOTOR_RUN  1
46
#define FLAG_FLY        2
46
#define FLAG_FLY        2
47
#define FLAG_CALIBRATE  4
47
#define FLAG_CALIBRATE  4
48
#define FLAG_START      8
48
#define FLAG_START      8
49
#define FLAG_NOTLANDUNG 16
49
#define FLAG_NOTLANDUNG 16
50
#define FLAG_LOWBAT     32
50
#define FLAG_LOWBAT     32
51
 
51
 
52
#define CFG_HOEHENREGELUNG       0x01
52
#define CFG_HOEHENREGELUNG       0x01
53
#define CFG_HOEHEN_SCHALTER      0x02
53
#define CFG_HOEHEN_SCHALTER      0x02
54
#define CFG_HEADING_HOLD         0x04
54
#define CFG_HEADING_HOLD         0x04
55
#define CFG_KOMPASS_AKTIV        0x08
55
#define CFG_KOMPASS_AKTIV        0x08
56
#define CFG_KOMPASS_FIX          0x10
56
#define CFG_KOMPASS_FIX          0x10
57
#define CFG_GPS_AKTIV            0x20
57
#define CFG_GPS_AKTIV            0x20
58
#define CFG_ACHSENKOPPLUNG_AKTIV 0x40
58
#define CFG_ACHSENKOPPLUNG_AKTIV 0x40
59
#define CFG_DREHRATEN_BEGRENZER  0x80
59
#define CFG_DREHRATEN_BEGRENZER  0x80
60
 
60
 
61
#define CFG_LOOP_OBEN            0x01
61
#define CFG_LOOP_OBEN            0x01
62
#define CFG_LOOP_UNTEN           0x02
62
#define CFG_LOOP_UNTEN           0x02
63
#define CFG_LOOP_LINKS           0x04
63
#define CFG_LOOP_LINKS           0x04
64
#define CFG_LOOP_RECHTS          0x08
64
#define CFG_LOOP_RECHTS          0x08
65
#define CFG_MOTOR_BLINK          0x10
65
#define CFG_MOTOR_BLINK          0x10
66
#define CFG_MOTOR_OFF_LED1       0x20
66
#define CFG_MOTOR_OFF_LED1       0x20
67
#define CFG_MOTOR_OFF_LED2       0x40
67
#define CFG_MOTOR_OFF_LED2       0x40
68
#define CFG_RES4                 0x80
68
#define CFG_RES4                 0x80
69
 
69
 
70
#define CFG2_HEIGHT_LIMIT        0x01
70
#define CFG2_HEIGHT_LIMIT        0x01
71
#define CFG2_VARIO_BEEP          0x02
71
#define CFG2_VARIO_BEEP          0x02
72
#define CFG_SENSITIVE_RC         0x04
72
#define CFG_SENSITIVE_RC         0x04
73
 
73
 
-
 
74
struct s_MK_Debug
-
 
75
{
-
 
76
 unsigned char Digital[2];
-
 
77
 int16_t Analog[32];    // Debugwerte
-
 
78
};
-
 
79
 
-
 
80
struct s_MK_DebugLabels
-
 
81
{
-
 
82
    int Position;
-
 
83
    QString Text;
-
 
84
};
-
 
85
 
-
 
86
//typedef int16_t s_MK_PPM_Data[26];
-
 
87
 
-
 
88
struct s_MK_PPM_Data
-
 
89
{
-
 
90
    int16_t Data[26];
-
 
91
};
-
 
92
 
-
 
93
 
74
struct s_MK_Settings
94
struct s_MK_Settings
75
{
95
{
76
    // Die ersten beiden Bytes nicht an den MK senden.
96
    // Die ersten beiden Bytes nicht an den MK senden.
77
   unsigned char Index;
97
   unsigned char Index;
78
   unsigned char Version;
98
   unsigned char Version;
79
 
99
 
80
   unsigned char Kanalbelegung[8];       // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
100
   unsigned char Kanalbelegung[12];       // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
81
   unsigned char GlobalConfig;           // 0x01=H�henregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
101
   unsigned char GlobalConfig;           // 0x01=H�henregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
82
   unsigned char Hoehe_MinGas;           // Wert : 0-100
102
   unsigned char Hoehe_MinGas;           // Wert : 0-100
83
   unsigned char Luftdruck_D;            // Wert : 0-250
103
   unsigned char Luftdruck_D;            // Wert : 0-250
84
   unsigned char MaxHoehe;               // Wert : 0-32
104
   unsigned char MaxHoehe;               // Wert : 0-32
85
   unsigned char Hoehe_P;                // Wert : 0-32
105
   unsigned char Hoehe_P;                // Wert : 0-32
86
   unsigned char Hoehe_Verstaerkung;     // Wert : 0-50
106
   unsigned char Hoehe_Verstaerkung;     // Wert : 0-50
87
   unsigned char Hoehe_ACC_Wirkung;      // Wert : 0-250
107
   unsigned char Hoehe_ACC_Wirkung;      // Wert : 0-250
88
   unsigned char Hoehe_HoverBand;        // Wert : 0-250
108
   unsigned char Hoehe_HoverBand;        // Wert : 0-250
89
   unsigned char Hoehe_GPS_Z;            // Wert : 0-250
109
   unsigned char Hoehe_GPS_Z;            // Wert : 0-250
90
   unsigned char Hoehe_StickNeutralPoint;// Wert : 0-250
110
   unsigned char Hoehe_StickNeutralPoint;// Wert : 0-250
91
   unsigned char Stick_P;                // Wert : 1-6
111
   unsigned char Stick_P;                // Wert : 1-6
92
   unsigned char Stick_D;                // Wert : 0-64
112
   unsigned char Stick_D;                // Wert : 0-64
93
   unsigned char Gier_P;                 // Wert : 1-20
113
   unsigned char Gier_P;                 // Wert : 1-20
94
   unsigned char Gas_Min;                // Wert : 0-32
114
   unsigned char Gas_Min;                // Wert : 0-32
95
   unsigned char Gas_Max;                // Wert : 33-250
115
   unsigned char Gas_Max;                // Wert : 33-250
96
   unsigned char GyroAccFaktor;          // Wert : 1-64
116
   unsigned char GyroAccFaktor;          // Wert : 1-64
97
   unsigned char KompassWirkung;         // Wert : 0-32
117
   unsigned char KompassWirkung;         // Wert : 0-32
98
   unsigned char Gyro_P;                 // Wert : 10-250
118
   unsigned char Gyro_P;                 // Wert : 10-250
99
   unsigned char Gyro_I;                 // Wert : 0-250
119
   unsigned char Gyro_I;                 // Wert : 0-250
100
   unsigned char Gyro_D;                 // Wert : 0-250
120
   unsigned char Gyro_D;                 // Wert : 0-250
101
   unsigned char Gyro_Gier_P;            // Wert : 10-250
121
   unsigned char Gyro_Gier_P;                 // Wert : 10-250
102
   unsigned char Gyro_Gier_I;            // Wert : 0-250
122
   unsigned char Gyro_Gier_I;                 // Wert : 0-250
103
   unsigned char UnterspannungsWarnung;  // Wert : 0-250
123
   unsigned char UnterspannungsWarnung;  // Wert : 0-250
104
   unsigned char NotGas;                 // Wert : 0-250     //Gaswert bei Emp�ngsverlust
124
   unsigned char NotGas;                 // Wert : 0-250     //Gaswert bei Emp�ngsverlust
105
   unsigned char NotGasZeit;             // Wert : 0-250     // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
125
   unsigned char NotGasZeit;             // Wert : 0-250     // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
106
   unsigned char UfoAusrichtung;         // X oder + Formation
126
   unsigned char Receiver;                       // 0= Summensignal, 1= Spektrum, 2 =Jeti, 3=ACT DSL, 4=ACT S3D
107
   unsigned char I_Faktor;               // Wert : 0-250
127
   unsigned char I_Faktor;               // Wert : 0-250
108
   unsigned char UserParam1;             // Wert : 0-250
128
   unsigned char UserParam1;             // Wert : 0-250
109
   unsigned char UserParam2;             // Wert : 0-250
129
   unsigned char UserParam2;             // Wert : 0-250
110
   unsigned char UserParam3;             // Wert : 0-250
130
   unsigned char UserParam3;             // Wert : 0-250
111
   unsigned char UserParam4;             // Wert : 0-250
131
   unsigned char UserParam4;             // Wert : 0-250
112
   unsigned char ServoNickControl;       // Wert : 0-250     // Stellung des Servos
132
   unsigned char ServoNickControl;       // Wert : 0-250     // Stellung des Servos
113
   unsigned char ServoNickComp;          // Wert : 0-250     // Einfluss Gyro/Servo
133
   unsigned char ServoNickComp;          // Wert : 0-250     // Einfluss Gyro/Servo
114
   unsigned char ServoNickMin;           // Wert : 0-250     // Anschlag
134
   unsigned char ServoNickMin;           // Wert : 0-250     // Anschlag
115
   unsigned char ServoNickMax;           // Wert : 0-250     // Anschlag
135
   unsigned char ServoNickMax;           // Wert : 0-250     // Anschlag
116
//--- Seit V0.75
136
//--- Seit V0.75
117
   unsigned char ServoRollControl;       // Wert : 0-250     // Stellung des Servos
137
   unsigned char ServoRollControl;       // Wert : 0-250     // Stellung des Servos
118
   unsigned char ServoRollComp;          // Wert : 0-250
138
   unsigned char ServoRollComp;          // Wert : 0-250
119
   unsigned char ServoRollMin;           // Wert : 0-250
139
   unsigned char ServoRollMin;           // Wert : 0-250
120
   unsigned char ServoRollMax;           // Wert : 0-250
140
   unsigned char ServoRollMax;           // Wert : 0-250
121
//---
141
//---
122
   unsigned char ServoNickRefresh;       //
142
   unsigned char ServoNickRefresh;       // Speed of the Servo
-
 
143
   unsigned char Servo3;                         // Value or mapping of the Servo Output
-
 
144
   unsigned char Servo4;                         // Value or mapping of the Servo Output
-
 
145
   unsigned char Servo5;                         // Value or mapping of the Servo Output
123
   unsigned char LoopGasLimit;           // Wert: 0-250  max. Gas w�hrend Looping
146
   unsigned char LoopGasLimit;           // Wert: 0-250  max. Gas w�hrend Looping
124
   unsigned char LoopThreshold;          // Wert: 0-250  Schwelle f�r Stickausschlag
147
   unsigned char LoopThreshold;          // Wert: 0-250  Schwelle f�r Stickausschlag
125
   unsigned char LoopHysterese;          // Wert: 0-250  Hysterese f�r Stickausschlag
148
   unsigned char LoopHysterese;          // Wert: 0-250  Hysterese f�r Stickausschlag
126
   unsigned char AchsKopplung1;          // Wert: 0-250  Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung)
149
   unsigned char AchsKopplung1;          // Wert: 0-250  Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung)
127
   unsigned char AchsKopplung2;          // Wert: 0-250  Faktor, mit dem Nick und Roll verkoppelt werden
150
   unsigned char AchsKopplung2;          // Wert: 0-250  Faktor, mit dem Nick und Roll verkoppelt werden
128
   unsigned char CouplingYawCorrection;  // 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
129
   unsigned char WinkelUmschlagNick;     // Wert: 0-250  180�-Punkt
152
   unsigned char WinkelUmschlagNick;     // Wert: 0-250  180�-Punkt
130
   unsigned char WinkelUmschlagRoll;     // Wert: 0-250  180�-Punkt
153
   unsigned char WinkelUmschlagRoll;     // Wert: 0-250  180�-Punkt
131
   unsigned char GyroAccAbgleich;        // 1/k  (Koppel_ACC_Wirkung)
154
   unsigned char GyroAccAbgleich;        // 1/k  (Koppel_ACC_Wirkung)
132
   unsigned char Driftkomp;
155
   unsigned char Driftkomp;
133
   unsigned char DynamicStability;
156
   unsigned char DynamicStability;
134
   unsigned char UserParam5;             // Wert : 0-250
157
   unsigned char UserParam5;             // Wert : 0-250
135
   unsigned char UserParam6;             // Wert : 0-250
158
   unsigned char UserParam6;             // Wert : 0-250
136
   unsigned char UserParam7;             // Wert : 0-250
159
   unsigned char UserParam7;             // Wert : 0-250
137
   unsigned char UserParam8;             // Wert : 0-250
160
   unsigned char UserParam8;             // Wert : 0-250
138
//---Output ---------------------------------------------
161
//---Output ---------------------------------------------
139
   unsigned char J16Bitmask;             // for the J16 Output
162
   unsigned char J16Bitmask;             // for the J16 Output
140
   unsigned char J16Timing;              // for the J16 Output
163
   unsigned char J16Timing;              // for the J16 Output
141
   unsigned char J17Bitmask;             // for the J17 Output
164
   unsigned char J17Bitmask;             // for the J17 Output
142
   unsigned char J17Timing;              // for the J17 Output
165
   unsigned char J17Timing;              // for the J17 Output
143
// seit version V0.75c
166
// seit version V0.75c
144
   unsigned char WARN_J16_Bitmask;       // for the J16 Output
167
   unsigned char WARN_J16_Bitmask;       // for the J16 Output
145
   unsigned char WARN_J17_Bitmask;       // for the J17 Output
168
   unsigned char WARN_J17_Bitmask;       // for the J17 Output
146
//---NaviCtrl---------------------------------------------
169
//---NaviCtrl---------------------------------------------
147
   unsigned char NaviGpsModeControl;     // Parameters for the Naviboard
170
   unsigned char NaviGpsModeControl;     // Parameters for the Naviboard
148
   unsigned char NaviGpsGain;
171
   unsigned char NaviGpsGain;
149
   unsigned char NaviGpsP;
172
   unsigned char NaviGpsP;
150
   unsigned char NaviGpsI;
173
   unsigned char NaviGpsI;
151
   unsigned char NaviGpsD;
174
   unsigned char NaviGpsD;
152
   unsigned char NaviGpsPLimit;
175
   unsigned char NaviGpsPLimit;
153
   unsigned char NaviGpsILimit;
176
   unsigned char NaviGpsILimit;
154
   unsigned char NaviGpsDLimit;
177
   unsigned char NaviGpsDLimit;
155
   unsigned char NaviGpsACC;
178
   unsigned char NaviGpsACC;
156
   unsigned char NaviGpsMinSat;
179
   unsigned char NaviGpsMinSat;
157
   unsigned char NaviStickThreshold;
180
   unsigned char NaviStickThreshold;
158
   unsigned char NaviWindCorrection;
181
   unsigned char NaviWindCorrection;
159
   unsigned char NaviSpeedCompensation;
182
   unsigned char NaviSpeedCompensation;
160
   unsigned char NaviOperatingRadius;
183
   unsigned char NaviOperatingRadius;
161
   unsigned char NaviAngleLimitation;
184
   unsigned char NaviAngleLimitation;
162
   unsigned char NaviPH_LoginTime;
185
   unsigned char NaviPH_LoginTime;
163
//---Ext.Ctrl---------------------------------------------
186
//---Ext.Ctrl---------------------------------------------
164
   unsigned char ExternalControl;        // for serial Control
187
   unsigned char ExternalControl;        // for serial Control
165
//------------------------------------------------
188
//------------------------------------------------
166
   unsigned char BitConfig;          // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
189
   unsigned char BitConfig;          // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
167
   unsigned char ServoCompInvert;    // //  0x01 = Nick, 0x02 = Roll   0 oder 1  // WICHTIG!!! am Ende lassen
190
   unsigned char ServoCompInvert;    // //  0x01 = Nick, 0x02 = Roll   0 oder 1  // WICHTIG!!! am Ende lassen
168
   unsigned char ExtraConfig;        // bitcodiert
191
   unsigned char ExtraConfig;        // bitcodiert
169
   char Name[12];
192
   char Name[12];
-
 
193
 
170
 };
194
 };
171
 
195
 
172
struct s_MK_Mixer
196
struct s_MK_Mixer
173
{
197
{
174
    char Revision;
198
    char Revision;
175
    char Name[12];
199
    char Name[12];
176
    signed char Motor[16][4];
200
    signed char Motor[16][4];
177
};
201
};
178
 
202
 
179
///////////////
203
///////////////
180
// Navi-Ctrl //
204
// Navi-Ctrl //
181
///////////////
205
///////////////
182
 
206
 
183
#define INVALID 0x00
207
#define INVALID 0x00
184
#define NEWDATA 0x01
208
#define NEWDATA 0x01
185
#define PROCESSED       0x02
209
#define PROCESSED       0x02
186
 
210
 
187
#define NC_FLAG_FREE            0x01
211
#define NC_FLAG_FREE            0x01
188
#define NC_FLAG_PH              0x02
212
#define NC_FLAG_PH              0x02
189
#define NC_FLAG_CH              0x04
213
#define NC_FLAG_CH              0x04
190
#define NC_FLAG_RANGE_LIMIT     0x08
214
#define NC_FLAG_RANGE_LIMIT     0x08
191
#define NC_FLAG_NOSERIALLINK    0x10
215
#define NC_FLAG_NOSERIALLINK    0x10
192
#define NC_FLAG_TARGET_REACHED  0x20
216
#define NC_FLAG_TARGET_REACHED  0x20
193
#define NC_FLAG_MANUAL_CONTROL  0x40
217
#define NC_FLAG_MANUAL_CONTROL  0x40
194
#define NC_FLAG_8               0x80
218
#define NC_FLAG_8               0x80
195
 
219
 
196
typedef struct
220
typedef struct
197
{
221
{
198
    int32_t Longitude;      // in 1E-7 deg
222
    int32_t Longitude;      // in 1E-7 deg
199
    int32_t Latitude;       // in 1E-7 deg
223
    int32_t Latitude;       // in 1E-7 deg
200
    int32_t Altitude;       // in mm
224
    int32_t Altitude;       // in mm
201
    uint8_t Status;         // validity of data
225
    uint8_t Status;         // validity of data
202
} __attribute__((packed)) GPS_Pos_t;
226
} __attribute__((packed)) GPS_Pos_t;
203
 
227
 
204
typedef struct
228
typedef struct
205
{
229
{
206
    uint16_t Distance;      // distance to target in dm
230
    uint16_t Distance;      // distance to target in dm
207
    int16_t Bearing;        // course to target in deg
231
    int16_t Bearing;        // course to target in deg
208
}  __attribute__((packed)) GPS_PosDev_t;
232
}  __attribute__((packed)) GPS_PosDev_t;
209
 
233
 
210
typedef struct
234
typedef struct
211
{
235
{
212
    uint8_t      Version;               // version of the data structure
236
    uint8_t      Version;               // version of the data structure
213
    GPS_Pos_t    CurrentPosition;               // see ubx.h for details
237
    GPS_Pos_t    CurrentPosition;               // see ubx.h for details
214
    GPS_Pos_t    TargetPosition;
238
    GPS_Pos_t    TargetPosition;
215
    GPS_PosDev_t TargetPositionDeviation;
239
    GPS_PosDev_t TargetPositionDeviation;
216
    GPS_Pos_t    HomePosition;
240
    GPS_Pos_t    HomePosition;
217
    GPS_PosDev_t HomePositionDeviation;
241
    GPS_PosDev_t HomePositionDeviation;
218
    uint8_t      WaypointIndex;         // index of current waypoints running from 0 to WaypointNumber-1
242
    uint8_t      WaypointIndex;         // index of current waypoints running from 0 to WaypointNumber-1
219
    uint8_t      WaypointNumber;                // number of stored waypoints
243
    uint8_t      WaypointNumber;                // number of stored waypoints
220
    uint8_t      SatsInUse;             // number of satellites used for position solution
244
    uint8_t      SatsInUse;             // number of satellites used for position solution
221
    int16_t      Altimeter;             // hight according to air pressure
245
    int16_t      Altimeter;             // hight according to air pressure
222
    int16_t      Variometer;            // climb(+) and sink(-) rate
246
    int16_t      Variometer;            // climb(+) and sink(-) rate
223
    uint16_t     FlyingTime;            // in seconds
247
    uint16_t     FlyingTime;            // in seconds
224
    uint8_t      UBat;                  // Battery Voltage in 0.1 Volts
248
    uint8_t      UBat;                  // Battery Voltage in 0.1 Volts
225
    uint16_t     GroundSpeed;           // speed over ground in cm/s (2D)
249
    uint16_t     GroundSpeed;           // speed over ground in cm/s (2D)
226
    int16_t      Heading;               // current flight direction in ° as angle to north
250
    int16_t      Heading;               // current flight direction in ° as angle to north
227
    int16_t      CompassHeading;                // current compass value in °
251
    int16_t      CompassHeading;                // current compass value in °
228
    int8_t       AngleNick;             // current Nick angle in 1°
252
    int8_t       AngleNick;             // current Nick angle in 1°
229
    int8_t       AngleRoll;             // current Rick angle in 1°
253
    int8_t       AngleRoll;             // current Rick angle in 1°
230
    uint8_t      RC_Quality;            // RC_Quality
254
    uint8_t      RC_Quality;            // RC_Quality
231
    uint8_t      MKFlags;               // Flags from FC
255
    uint8_t      MKFlags;               // Flags from FC
232
    uint8_t      NCFlags;               // Flags from NC
256
    uint8_t      NCFlags;               // Flags from NC
233
    uint8_t      Errorcode;             // 0 --> okay
257
    uint8_t      Errorcode;             // 0 --> okay
234
    uint8_t      OperatingRadius;               // current operation radius around the Home Position in m
258
    uint8_t      OperatingRadius;               // current operation radius around the Home Position in m
235
    int16_t      TopSpeed;              // velocity in vertical direction in cm/s
259
    int16_t      TopSpeed;              // velocity in vertical direction in cm/s
236
    uint8_t      TargetHoldTime;                // time in s to stay at the given target, counts down to 0 if target has been reached
260
    uint8_t      TargetHoldTime;                // time in s to stay at the given target, counts down to 0 if target has been reached
237
    uint8_t      RC_RSSI;               // Receiver signal strength (since version 2 added)
261
    uint8_t      RC_RSSI;               // Receiver signal strength (since version 2 added)
238
    int16_t      SetpointAltitude;                      // setpoint for altitude
262
    int16_t      SetpointAltitude;                      // setpoint for altitude
239
    uint8_t      Gas;                                           // for future use
263
    uint8_t      Gas;                                           // for future use
-
 
264
    uint16_t     Current;                                       // actual current in 0.1A steps
-
 
265
    uint16_t     UsedCapacity;                          // used capacity in mAh
-
 
266
 
240
} __attribute__((packed)) s_MK_NaviData;
267
} __attribute__((packed)) s_MK_NaviData;
241
 
268
 
242
typedef struct
269
typedef struct
243
{
270
{
244
    GPS_Pos_t Position;          // the gps position of the waypoint, see ubx.h for details
271
    GPS_Pos_t Position;          // the gps position of the waypoint, see ubx.h for details
245
    int16_t   Heading;           // orientation, future implementation
272
    int16_t   Heading;           // orientation, future implementation
246
    uint8_t   ToleranceRadius;   // in meters, if the MK is within that range around the target, then the next target is triggered
273
    uint8_t   ToleranceRadius;   // in meters, if the MK is within that range around the target, then the next target is triggered
247
    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
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
248
    uint8_t   Event_Flag;        // future emplementation
275
    uint8_t   Event_Flag;        // future emplementation
249
    uint8_t   reserve[12];       // reserve
276
    uint8_t   reserve[12];       // reserve
250
} __attribute__((packed)) s_MK_WayPoint;
277
} __attribute__((packed)) s_MK_WayPoint;
251
 
278
 
252
#endif // MK_DATATYPES_H
279
#endif // MK_DATATYPES_H
253
 
280