Subversion Repositories Projects

Rev

Rev 1866 | Rev 2000 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1866 Rev 1992
Line 41... Line 41...
41
#define NC_ADDRESS 2
41
#define NC_ADDRESS 2
42
#define MK3MAG_ADDRESS 3
42
#define MK3MAG_ADDRESS 3
43
#define MKOSD_ADDRESS 4
43
#define MKOSD_ADDRESS 4
44
#define BL_ADDRESS 5
44
#define BL_ADDRESS 5
45
 
45
 
46
 
-
 
47
/*
46
/*
48
 * FC Debug Struct
47
 * FC Debug Struct
49
 * portions taken and adapted from
48
 * portions taken and adapted from
50
 * http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=/tags/V0.88e/uart.h
49
 * http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=/tags/V0.88e/uart.h
51
 */
50
 */
52
typedef struct  {
51
typedef struct {
53
        unsigned char Status[2];
52
    unsigned char Status[2];
54
        signed int Analog[32];    // Debugwerte
53
    signed int Analog[32]; // Debugwerte
55
} __attribute__((packed)) str_DebugOut;
54
} __attribute__((packed)) str_DebugOut;
56
 
55
 
57
typedef struct {
56
typedef struct {
58
        unsigned char SWMajor;
57
    unsigned char SWMajor;
59
        unsigned char SWMinor;
58
    unsigned char SWMinor;
60
        unsigned char ProtoMajor;
59
    unsigned char ProtoMajor;
61
        unsigned char ProtoMinor;
60
    unsigned char ProtoMinor;
62
        unsigned char SWPatch;
61
    unsigned char SWPatch;
63
        unsigned char HardwareError[5];
62
    unsigned char HardwareError[5];
64
} __attribute__((packed)) str_VersionInfo;
63
} __attribute__((packed)) str_VersionInfo;
65
 
64
 
66
/*
65
/*
67
 * NaviCtrl GPS Structs
66
 * NaviCtrl GPS Structs
68
 * portions taken and adapted from
67
 * portions taken and adapted from
69
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V0.20c/ubx.h
68
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V0.20c/ubx.h
70
 */
69
 */
71
typedef struct {
70
typedef struct {
72
        s32 Longitude;  // in 1E-7 deg
71
    s32 Longitude; // in 1E-7 deg
73
        s32 Latitude;   // in 1E-7 deg
72
    s32 Latitude; // in 1E-7 deg
74
        s32 Altitude;   // in mm
73
    s32 Altitude; // in mm
75
        u8 Status;// validity of data
74
    u8 Status; // validity of data
76
} __attribute__((packed)) GPS_Pos_t;
75
} __attribute__((packed)) GPS_Pos_t;
77
 
76
 
78
#define INVALID         0x00
77
#define INVALID         0x00
79
#define NEWDATA         0x01
78
#define NEWDATA         0x01
80
#define PROCESSED       0x02
79
#define PROCESSED       0x02
81
 
80
 
82
 
-
 
83
/*
81
/*
84
 * NaviCtrl OSD Structs
82
 * NaviCtrl OSD Structs
85
 * portions taken and adapted from
83
 * portions taken and adapted from
86
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V0.24b/uart1.h
84
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V0.24b/uart1.h
87
 */
85
 */
88
typedef struct {
86
typedef struct {
89
        u16 Distance;                                   // distance to target in dm
87
    u16 Distance; // distance to target in dm
90
        s16 Bearing;                                    // course to target in deg
88
    s16 Bearing; // course to target in deg
91
} __attribute__((packed)) GPS_PosDev_t;
89
} __attribute__((packed)) GPS_PosDev_t;
92
 
90
 
93
typedef struct {
91
typedef struct {
94
        u8 Version;                                             // version of the data structure
92
    u8 Version; // version of the data structure
95
        GPS_Pos_t CurrentPosition;                              // see ubx.h for details
93
    GPS_Pos_t CurrentPosition; // see ubx.h for details
96
        GPS_Pos_t TargetPosition;
94
    GPS_Pos_t TargetPosition;
97
        GPS_PosDev_t TargetPositionDeviation;
95
    GPS_PosDev_t TargetPositionDeviation;
98
        GPS_Pos_t HomePosition;
96
    GPS_Pos_t HomePosition;
99
        GPS_PosDev_t HomePositionDeviation;
97
    GPS_PosDev_t HomePositionDeviation;
100
        u8  WaypointIndex;                              // index of current waypoints running from 0 to WaypointNumber-1
98
    u8 WaypointIndex; // index of current waypoints running from 0 to WaypointNumber-1
101
        u8  WaypointNumber;                             // number of stored waypoints
99
    u8 WaypointNumber; // number of stored waypoints
102
        u8  SatsInUse;                                  // number of satellites used for position solution
100
    u8 SatsInUse; // number of satellites used for position solution
103
        s16 Altimeter;                                  // hight according to air pressure
101
    s16 Altimeter; // hight according to air pressure
104
        s16 Variometer;                                 // climb(+) and sink(-) rate
102
    s16 Variometer; // climb(+) and sink(-) rate
105
        u16 FlyingTime;                                 // in seconds
103
    u16 FlyingTime; // in seconds
106
        u8  UBat;                                       // Battery Voltage in 0.1 Volts
104
    u8 UBat; // Battery Voltage in 0.1 Volts
107
        u16 GroundSpeed;                                // speed over ground in cm/s (2D)
105
    u16 GroundSpeed; // speed over ground in cm/s (2D)
108
        s16 Heading;                                    // current flight direction in ° as angle to north
106
    s16 Heading; // current flight direction in ° as angle to north
109
        s16 CompassHeading;                             // current compass value in °
107
    s16 CompassHeading; // current compass value in °
110
        s8  AngleNick;                                  // current Nick angle in 1°
108
    s8 AngleNick; // current Nick angle in 1°
111
        s8  AngleRoll;                                  // current Rick angle in 1°
109
    s8 AngleRoll; // current Rick angle in 1°
112
        u8  RC_Quality;                                 // RC_Quality
110
    u8 RC_Quality; // RC_Quality
113
        u8  FCFlags;                                    // Flags from FC
111
    u8 FCFlags; // Flags from FC
114
        u8  NCFlags;                                    // Flags from NC
112
    u8 NCFlags; // Flags from NC
115
        u8  Errorcode;                                  // 0 --> okay
113
    u8 Errorcode; // 0 --> okay
116
        u8  OperatingRadius;                            // current operation radius around the Home Position in m
114
    u8 OperatingRadius; // current operation radius around the Home Position in m
117
        s16 TopSpeed;                                   // velocity in vertical direction in cm/s
115
    s16 TopSpeed; // velocity in vertical direction in cm/s
118
        u8  TargetHoldTime;                             // time in s to stay at the given target, counts down to 0 if target has been reached
116
    u8 TargetHoldTime; // time in s to stay at the given target, counts down to 0 if target has been reached
119
        u8  FCStatusFlags2;                             // StatusFlags2 (since version 5 added)
117
    u8 FCStatusFlags2; // StatusFlags2 (since version 5 added)
120
        s16 SetpointAltitude;                           // setpoint for altitude
118
    s16 SetpointAltitude; // setpoint for altitude
121
        u8  Gas;                                        // for future use
119
    u8 Gas; // for future use
122
        u16 Current;                                    // actual current in 0.1A steps
120
    u16 Current; // actual current in 0.1A steps
123
        u16 UsedCapacity;                               // used capacity in mAh
121
    u16 UsedCapacity; // used capacity in mAh
124
} __attribute__((packed)) NaviData_t;
122
} __attribute__((packed)) NaviData_t;
125
 
123
 
126
#define NC_FLAG_FREE                    0x01
124
#define NC_FLAG_FREE                    0x01
127
#define NC_FLAG_PH                              0x02
125
#define NC_FLAG_PH                              0x02
128
#define NC_FLAG_CH                              0x04
126
#define NC_FLAG_CH                              0x04
Line 163... Line 161...
163
#define DEFEKT_BL_MISSING       0x02
161
#define DEFEKT_BL_MISSING       0x02
164
#define DEFEKT_SPI_RX_ERR       0x04
162
#define DEFEKT_SPI_RX_ERR       0x04
165
#define DEFEKT_PPM_ERR          0x08
163
#define DEFEKT_PPM_ERR          0x08
166
#define DEFEKT_MIXER_ERR    0x10
164
#define DEFEKT_MIXER_ERR    0x10
167
 
165
 
168
 
-
 
169
/*
166
/*
170
 * MikroKopter config struct
167
 * MikroKopter config struct
171
 * portions taken and adapted from
168
 * portions taken and adapted from
172
 * http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=/tags/V0.88e/eeprom.h
169
 * http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=/tags/V0.90j/eeprom.h
173
 */
170
 */
174
typedef struct {
171
typedef struct {
286
 
284
 
287
typedef struct {
285
typedef struct {
288
        u8 SettingsIndex;
286
    u8 SettingsIndex;
289
        paramset_t param;
287
    paramset_t param;
290
} __attribute__((packed)) paramset_serial;
288
} __attribute__((packed)) paramset_serial;
291
 
289
 
292
 
-
 
293
 
-
 
294
/*
290
/*
295
 * MikroKopter 3D-Data struct
291
 * MikroKopter 3D-Data struct
296
 * portions taken and adapted from
292
 * portions taken and adapted from
297
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=%2Ftags%2FV0.28o%2Fuart1.h
293
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=%2Ftags%2FV0.28o%2Fuart1.h
298
 */
294
 */
299
typedef struct {
295
typedef struct {
300
    s16 AngleNick;  // in 0.1 deg
296
    s16 AngleNick; // in 0.1 deg
301
    s16 AngleRoll;   // in 0.1 deg
297
    s16 AngleRoll; // in 0.1 deg
302
    s16 Heading;    // in 0.1 deg
298
    s16 Heading; // in 0.1 deg
303
    u8 StickNick;
299
    u8 StickNick;
304
    u8 StickRoll;
300
    u8 StickRoll;
305
    u8 StickYaw;
301
    u8 StickYaw;
306
    u8 StickGas;
302
    u8 StickGas;
307
    u8 reserve[4];
303
    u8 reserve[4];
308
} __attribute__((packed)) Data3D_t;
304
} __attribute__((packed)) Data3D_t;
309
 
305
 
310
extern Data3D_t Data3D;
306
extern Data3D_t Data3D;
311
 
307
 
312
#endif
308
#endif
313
 
309