Subversion Repositories Projects

Rev

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

Rev 2099 Rev 2217
Line 44... Line 44...
44
#define BL_ADDRESS 5
44
#define BL_ADDRESS 5
Line 45... Line 45...
45
 
45
 
46
/*
46
/*
47
 * FC Debug Struct
47
 * FC Debug Struct
48
 * portions taken and adapted from
48
 * portions taken and adapted from
49
 * 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/V2.12a/uart.h
50
 */
50
 */
51
typedef struct {
51
typedef struct {
52
    unsigned char Status[2];
52
    unsigned char Status[2];
53
    signed int Analog[32]; // Debugwerte
53
    signed int Analog[32]; // Debugwerte
Line 54... Line 54...
54
} __attribute__((packed)) str_DebugOut;
54
} __attribute__((packed)) str_DebugOut;
55
 
55
 
56
typedef struct {
56
typedef struct {
57
    unsigned char SWMajor;
57
        unsigned char SWMajor;
58
    unsigned char SWMinor;
58
        unsigned char SWMinor;
59
    unsigned char ProtoMajor;
59
        unsigned char ProtoMajor;
60
    unsigned char ProtoMinor;
60
        unsigned char LabelTextCRC;
-
 
61
        unsigned char SWPatch;
-
 
62
        unsigned char HardwareError[2];
-
 
63
        unsigned char HWMajor;
61
    unsigned char SWPatch;
64
        unsigned char BL_Firmware;  
Line 62... Line 65...
62
    unsigned char HardwareError[5];
65
        unsigned char Flags;
63
} __attribute__((packed)) str_VersionInfo;
66
} __attribute__((packed)) str_VersionInfo;
64
 
67
 
65
/*
68
/*
66
 * NaviCtrl GPS Structs
69
 * NaviCtrl GPS Structs
67
 * portions taken and adapted from
70
 * portions taken and adapted from
68
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V0.20c/ubx.h
71
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V2.12a/gpspos.h
69
 */
72
 */
70
typedef struct {
73
typedef struct {
Line 75... Line 78...
75
} __attribute__((packed)) GPS_Pos_t;
78
} __attribute__((packed)) GPS_Pos_t;
Line 76... Line 79...
76
 
79
 
77
#define INVALID         0x00
80
#define INVALID         0x00
78
#define NEWDATA         0x01
81
#define NEWDATA         0x01
-
 
82
#define PROCESSED       0x02
Line 79... Line 83...
79
#define PROCESSED       0x02
83
#define SIMULATION      0x03
80
 
84
 
81
/*
85
/*
82
 * NaviCtrl OSD Structs
86
 * NaviCtrl OSD Structs
83
 * portions taken and adapted from
87
 * portions taken and adapted from
84
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V2.06a/uart1.h
88
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V2.12a/uart1.h
85
 */
89
 */
86
typedef struct {
90
typedef struct {
87
    u16 Distance; // distance to target in dm
91
    u16 Distance; // distance to target in dm
Line 111... Line 115...
111
    s8 AngleRoll; // current Rick angle in 1°
115
    s8 AngleRoll; // current Rick angle in 1°
112
    u8 RC_Quality; // RC_Quality
116
    u8 RC_Quality; // RC_Quality
113
    u8 FCStatusFlags; // Flags from FC
117
    u8 FCStatusFlags; // Flags from FC
114
    u8 NCFlags; // Flags from NC
118
    u8 NCFlags; // Flags from NC
115
    u8 Errorcode; // 0 --> okay
119
    u8 Errorcode; // 0 --> okay
116
    u8 OperatingRadius; // current operation radius around the Home Position in m
120
    u8  WP_OperatingRadius; // current WP operation radius around the Home Position in m
117
    s16 TopSpeed; // velocity in vertical direction in cm/s
121
    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
122
    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)
123
    u8 FCStatusFlags2; // StatusFlags2 (since version 5 added)
120
    s16 SetpointAltitude; // setpoint for altitude
124
    s16 SetpointAltitude; // setpoint for altitude
121
    u8 Gas; // for future use
125
    u8 Gas; // for future use
122
    u16 Current; // actual current in 0.1A steps
126
    u16 Current; // actual current in 0.1A steps
123
    u16 UsedCapacity; // used capacity in mAh
127
    u16 UsedCapacity; // used capacity in mAh
124
} __attribute__((packed)) NaviData_t;
128
} __attribute__((packed)) NaviData_t;
Line -... Line 129...
-
 
129
 
-
 
130
/*
-
 
131
 * NaviCtrl & FCFlags Flags
-
 
132
 * portions taken and adapted from
-
 
133
 * http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V2.12a/main.h
-
 
134
 */
125
 
135
 // .NCFlags
126
#define NC_FLAG_FREE                    0x01
136
#define NC_FLAG_FREE                    0x01
127
#define NC_FLAG_PH                              0x02
137
#define NC_FLAG_PH                              0x02
128
#define NC_FLAG_CH                              0x04
138
#define NC_FLAG_CH                              0x04
129
#define NC_FLAG_RANGE_LIMIT             0x08
139
#define NC_FLAG_RANGE_LIMIT             0x08
130
#define NC_FLAG_NOSERIALLINK    0x10
140
#define NC_FLAG_NOSERIALLINK    0x10
131
#define NC_FLAG_TARGET_REACHED  0x20
141
#define NC_FLAG_TARGET_REACHED  0x20
132
#define NC_FLAG_MANUAL_CONTROL  0x40
142
#define NC_FLAG_MANUAL_CONTROL  0x40
Line 133... Line -...
133
#define NC_FLAG_GPS_OK                  0x80
-
 
134
 
143
#define NC_FLAG_GPS_OK                  0x80
135
/*
-
 
136
 * MikroKopter Flags
-
 
137
 * portions taken and adapted from
-
 
138
 * http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=/tags/V0.80d/fc.h
144
 
139
 */
145
// FC.StatusFlags
140
#define FCFLAG_MOTOR_RUN        0x01
146
#define FCFLAG_MOTOR_RUN        0x01
141
#define FCFLAG_FLY              0x02
147
#define FCFLAG_FLY              0x02
142
#define FCFLAG_CALIBRATE        0x04
148
#define FCFLAG_CALIBRATE        0x04
143
#define FCFLAG_START            0x08
149
#define FCFLAG_START            0x08
144
#define FCFLAG_NOTLANDUNG       0x10
150
#define FCFLAG_NOTLANDUNG       0x10
145
#define FCFLAG_LOWBAT           0x20
151
#define FCFLAG_LOWBAT           0x20
Line 146... Line 152...
146
#define FCFLAG_VARIO_TRIM_UP    0x40
152
#define FCFLAG_VARIO_TRIM_UP    0x40
147
#define FCFLAG_VARIO_TRIM_DOWN  0x80
153
#define FCFLAG_VARIO_TRIM_DOWN  0x80
148
 
154
 
-
 
155
// FC.StatusFlags2
-
 
156
#define FC_STATUS2_CAREFREE                 0x01
-
 
157
#define FC_STATUS2_ALTITUDE_CONTROL         0x02
-
 
158
#define FC_STATUS2_RC_FAILSAVE_ACTIVE       0x04
-
 
159
#define FC_STATUS2_OUT1_ACTIVE                  0x08
149
// FC STATUS FLAGS2
160
#define FC_STATUS2_OUT2_ACTIVE                  0x10
-
 
161
#define FC_STATUS2_WAIT_FOR_TAKEOFF             0x20   // Motor Running, but still on the ground
-
 
162
 
-
 
163
 
-
 
164
// FC.StatusFlags3
-
 
165
#define FC_STATUS3_REDUNDANCE_AKTIVE        0x01
-
 
166
#define FC_STATUS3_BOAT                         0x02
-
 
167
#define FC_STATUS3_REDUNDANCE_ERROR                     0x04
150
#define FC_STATUS2_CAREFREE                 0x01
168
#define FC_STATUS3_REDUNDANCE_TEST                      0x08
151
#define FC_STATUS2_ALTITUDE_CONTROL         0x02
169
 
152
 
170
// FC ERRORS FLAGS
153
#define DEFEKT_G_NICK           0x01
171
#define FC_ERROR0_GYRO_NICK     0x01
154
#define DEFEKT_G_ROLL           0x02
172
#define FC_ERROR0_GYRO_ROLL     0x02
155
#define DEFEKT_G_GIER           0x04
173
#define FC_ERROR0_GYRO_YAW              0x04
156
#define DEFEKT_A_NICK           0x08
174
#define FC_ERROR0_ACC_NICK              0x08
157
#define DEFEKT_A_ROLL           0x10
175
#define FC_ERROR0_ACC_ROLL              0x10
158
#define DEFEKT_A_Z              0x20
176
#define FC_ERROR0_ACC_TOP               0x20
159
#define DEFEKT_PRESSURE         0x40
177
#define FC_ERROR0_PRESSURE              0x40
160
#define DEFEKT_CAREFREE_ERR 0x80
178
#define FC_ERROR0_CAREFREE              0x80
161
 
179
 
162
#define DEFEKT_I2C              0x01
180
#define FC_ERROR1_I2C                   0x01
163
#define DEFEKT_BL_MISSING       0x02
181
#define FC_ERROR1_BL_MISSING    0x02
-
 
182
#define FC_ERROR1_SPI_RX                0x04
-
 
183
#define FC_ERROR1_PPM                   0x08
-
 
184
#define FC_ERROR1_MIXER                 0x10
Line 164... Line 185...
164
#define DEFEKT_SPI_RX_ERR       0x04
185
#define FC_ERROR1_RES1                  0x20
165
#define DEFEKT_PPM_ERR          0x08
186
#define FC_ERROR1_RES2                  0x40
166
#define DEFEKT_MIXER_ERR    0x10
187
#define FC_ERROR1_RES3                  0x80
167
 
188
 
168
/*
189
/*
Line 169... Line 190...
169
 * MikroKopter config struct
190
 * MikroKopter config struct
170
 * portions taken and adapted from
-
 
-
 
191
 * portions taken and adapted from
Line 171... Line 192...
171
 * http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=/tags/V2.10a/eeprom.h
192
 * http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=/tags/V2.12a/eeprom.h
172
 */
193
 */
173
 
194
 
174
#define EEPARAM_REVISION        105 // is count up, if paramater stucture has changed (compatibility)
195
#define EEPARAM_REVISION        106 // is count up, if paramater stucture has changed (compatibility)
Line 292... Line 313...
292
        unsigned char AutoLandingVoltage;    // in 0,1V  0 -> disabled
313
        unsigned char AutoLandingVoltage;    // in 0,1V  0 -> disabled
293
        unsigned char ComingHomeVoltage;    // in 0,1V  0 -> disabled
314
        unsigned char ComingHomeVoltage;    // in 0,1V  0 -> disabled
294
        unsigned char AutoPhotoAtitudes;
315
        unsigned char AutoPhotoAtitudes;
295
        unsigned char SingleWpSpeed;
316
        unsigned char SingleWpSpeed;
296
        unsigned char LandingPulse;
317
        unsigned char LandingPulse;
-
 
318
        unsigned char SingleWpControlChannel;
-
 
319
        unsigned char MenuKeyChannel;
297
        //------------------------------------------------
320
        //------------------------------------------------
298
        unsigned char BitConfig;          // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
321
        unsigned char BitConfig;          // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
299
        unsigned char ServoCompInvert;    // //  0x01 = Nick, 0x02 = Roll, 0x04 = relative moving // WICHTIG!!! am Ende lassen
322
        unsigned char ServoCompInvert;    // //  0x01 = Nick, 0x02 = Roll, 0x04 = relative moving // WICHTIG!!! am Ende lassen
300
        unsigned char ExtraConfig;        // bitcodiert
323
        unsigned char ExtraConfig;        // bitcodiert
301
        unsigned char GlobalConfig3;      // bitcodiert
324
        unsigned char GlobalConfig3;      // bitcodiert