Subversion Repositories Projects

Rev

Rev 2225 | Rev 2598 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2225 Rev 2569
Line 83... Line 83...
83
#define SIMULATION      0x03
83
#define SIMULATION      0x03
Line 84... Line 84...
84
 
84
 
85
/*
85
/*
86
 * NaviCtrl OSD Structs
86
 * NaviCtrl OSD Structs
87
 * portions taken and adapted from
87
 * portions taken and adapted from
88
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V2.12a/uart1.h
88
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V2.16a/uart1.h
89
 */
89
 */
90
typedef struct {
90
typedef struct {
91
    u16 Distance; // distance to target in dm
91
    u16 Distance; // distance to target in dm
92
    s16 Bearing; // course to target in deg
92
    s16 Bearing; // course to target in deg
Line 93... Line 93...
93
} __attribute__((packed)) GPS_PosDev_t;
93
} __attribute__((packed)) GPS_PosDev_t;
Line 94... Line 94...
94
 
94
 
-
 
95
#define NAVIDATA_VERSION 5
95
#define NAVIDATA_VERSION 5
96
 
96
 
97
typedef struct   // 84 Bytes    (note: this is the old protocol)
97
typedef struct {
98
{
98
        u8 Version;                                             // version of the data structure
99
        u8 Version;                                             // version of the data structure = 5 
99
        GPS_Pos_t CurrentPosition;              // see gpspos.h for details
100
        GPS_Pos_t CurrentPosition;              // see gpspos.h for details
100
        GPS_Pos_t TargetPosition;
101
        GPS_Pos_t TargetPosition;
Line 112... Line 113...
112
        s16 Heading;                                    // current flight direction in ° as angle to north
113
        s16 Heading;                                    // current flight direction in ° as angle to north
113
        s16     CompassHeading;                         // current compass value in °
114
        s16     CompassHeading;                         // current compass value in °
114
        s8  AngleNick;                                  // current Nick angle in 1°
115
        s8  AngleNick;                                  // current Nick angle in 1°
115
        s8  AngleRoll;                                  // current Rick angle in 1°
116
        s8  AngleRoll;                                  // current Rick angle in 1°
116
        u8  RC_Quality;                                 // RC_Quality
117
        u8  RC_Quality;                                 // RC_Quality
117
        u8  FCStatusFlags;                              // Flags from FC
118
        u8  FCStatusFlags;                              // Flags from FC see main.c FC_STATUS_xxx
118
        u8  NCFlags;                                    // Flags from NC
119
        u8  NCFlags;                                    // Flags from NC see main.h NC_FLAG_xxx
119
        u8  Errorcode;                                  // 0 --> okay
120
        u8  Errorcode;                                  // 0 --> okay
120
        u8  WP_OperatingRadius;                 // current WP operation radius around the Home Position in m
121
        u8  WP_OperatingRadius;                 // current WP operation radius around the Home Position in m
121
        s16 TopSpeed;                                   // velocity in vertical direction in cm/s
122
        s16 TopSpeed;                                   // velocity in vertical direction in cm/s
122
        u8  TargetHoldTime;                             // time in s to stay at the given target, counts down to 0 if target has been reached
123
        u8  TargetHoldTime;                             // time in s to stay at the given target, counts down to 0 if target has been reached
123
        u8  FCStatusFlags2;                             // StatusFlags2 (since version 5 added)
124
        u8  FCStatusFlags2;                             // StatusFlags2 (since version 5 added)
124
        s16 SetpointAltitude;                   // setpoint for altitude
125
        s16 SetpointAltitude;                   // setpoint for altitude
125
        u8  Gas;                                                // for future use
126
        u8  Gas;                                                // current gas (thrust)
126
        u16 Current;                                    // actual current in 0.1A steps
127
        u16 Current;                                    // actual current in 0.1A steps
127
        u16 UsedCapacity;                               // used capacity in mAh
128
        u16 UsedCapacity;                               // used capacity in mAh
-
 
129
        u8 reserve1;                                    // to fit into 84 bytes (must be divisible by 3) 
-
 
130
        u8 reserve2;                                    // to fit into 84 bytes (must be divisible by 3)
128
} __attribute__((packed)) NaviData_t;
131
} __attribute__((packed)) NaviData_t;
-
 
132
extern NaviData_t NaviData;
Line 129... Line 133...
129
 
133
 
130
/*
134
/*
131
 * NaviCtrl & FCFlags Flags
135
 * NaviCtrl & FCFlags Flags
132
 * portions taken and adapted from
136
 * portions taken and adapted from
Line 190... Line 194...
190
#define FC_ERROR1_RES3                  0x80
194
#define FC_ERROR1_RES3                  0x80
Line 191... Line 195...
191
 
195
 
192
/*
196
/*
193
 * MikroKopter config struct
197
 * MikroKopter config struct
194
 * portions taken and adapted from
198
 * portions taken and adapted from
195
 * http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=/tags/V2.12a/eeprom.h
199
 * http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=/tags/V2.16a/eeprom.h
Line 196... Line 200...
196
 */
200
 */
197
 
201
 
-
 
202
#define EEPARAM_REVISION        109 // !!!Update NC also!!! is count up, if paramater stucture has changed (compatibility)
-
 
203
#define EEMIXER_REVISION        1       // is count up, if mixer stucture has changed (compatibility)
-
 
204
#define EE_BACKWARD_COMP        1   // change if the eepropm parameters are not backwards compatible
Line 198... Line 205...
198
#define EEPARAM_REVISION        108 // is count up, if paramater stucture has changed (compatibility)
205
 
199
#define EEMIXER_REVISION          1 // is count up, if mixer stucture has changed (compatibility)
206
 
200
 
207
 
201
typedef struct
208
typedef struct
Line 329... Line 336...
329
        unsigned char ExtraConfig;        // bitcodiert
336
        unsigned char ExtraConfig;        // bitcodiert
330
        unsigned char GlobalConfig3;      // bitcodiert
337
        unsigned char GlobalConfig3;      // bitcodiert
331
        char Name[12];
338
        char Name[12];
332
        unsigned char crc;                              // must be the last byte!
339
        unsigned char crc;                                // must be the last byte!
333
} paramset_t; // since 2.14 -> size is always 179 Bytes
340
} paramset_t;      // since 2.14 -> size is always 179 Bytes
-
 
341
// -> if changed: update NC-Data structure also <-
Line 334... Line 342...
334
 
342
 
335
 
343
 
336
typedef struct {
344
typedef struct {