Subversion Repositories Projects

Rev

Rev 676 | Rev 728 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
331 cascade 1
/****************************************************************************
2
 *   Copyright (C) 2009 by Claas Anders "CaScAdE" Rathje                    *
3
 *   admiralcascade@gmail.com                                               *
4
 *   Project-URL: http://www.mylifesucks.de/oss/c-osd/                      *
5
 *                                                                          *
6
 *   This program is free software; you can redistribute it and/or modify   *
7
 *   it under the terms of the GNU General Public License as published by   *
8
 *   the Free Software Foundation; either version 2 of the License.         *
9
 *                                                                          *
10
 *   This program is distributed in the hope that it will be useful,        *
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
13
 *   GNU General Public License for more details.                           *
14
 *                                                                          *
15
 *   You should have received a copy of the GNU General Public License      *
16
 *   along with this program; if not, write to the                          *
17
 *   Free Software Foundation, Inc.,                                        *
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.              *
19
 ****************************************************************************/
20
 
21
/* ##########################################################################
22
 * gain some fake arm compat :)
23
 * ##########################################################################*/
24
#define u8 uint8_t
25
#define s8 int8_t
26
#define u16 uint16_t
27
#define s16 int16_t
28
#define u32 uint32_t
29
#define s32 int32_t
30
 
31
/*
32
 * FC Debug Struct
33
 * portions taken and adapted from
34
 * http://svn.mikrokopter.de/mikrowebsvn/filedetails.php?repname=FlightCtrl&path=%2Ftags%2FV0.72p%2Fuart.h
35
 */
36
typedef struct {
37
    uint8_t Digital[2];
38
    uint16_t Analog[32]; // Debugvalues
39
} __attribute__((packed)) DebugOut_t;
40
 
677 cascade 41
 
42
typedef struct {
43
  unsigned char SWMajor;
44
  unsigned char SWMinor;
45
  unsigned char ProtoMajor;
46
  unsigned char ProtoMinor;
47
  unsigned char SWPatch;
48
  unsigned char Reserved[5];
49
} str_VersionInfo;
50
 
51
 
331 cascade 52
/*
53
 * NaviCtrl OSD Structs
675 cascade 54
 * portions taken and adapted from
55
 * http://svn.mikrokopter.de/mikrowebsvn/filedetails.php?repname=NaviCtrl&path=%2Ftags%2FV0.17e%2Fuart1.h
331 cascade 56
 */
57
typedef struct {
58
    s32 Longitude; // in 1E-7 deg
59
    s32 Latitude; // in 1E-7 deg
60
    s32 Altitude; // in mm
61
    u8 Status; // validity of data
675 cascade 62
} __attribute__((packed)) GPS_Pos_t;
63
#define INVALID         0x00
64
#define NEWDATA         0x01
65
#define PROCESSED       0x02
331 cascade 66
 
675 cascade 67
 
676 cascade 68
typedef struct {
        u16 Distance;                                   // distance to target in cm
675 cascade 69
        s16 Bearing;                                    // course to target in deg
70
} __attribute__((packed)) GPS_PosDev_t;
331 cascade 71
72
 
73
        u8 Version;                                     // version of the data structure
675 cascade 74
        GPS_Pos_t CurrentPosition;              	// see ubx.h for details
75
        GPS_Pos_t TargetPosition;
76
        GPS_PosDev_t TargetPositionDeviation;
77
        GPS_Pos_t HomePosition;
78
        GPS_PosDev_t HomePositionDeviation;
79
        u8  WaypointIndex;                              // index of current waypoints running from 0 to WaypointNumber-1
80
        u8  WaypointNumber;                             // number of stored waypoints
81
        u8  SatsInUse;                                  // number of satellites used for position solution
82
        s16 Altimeter;                                  // hight according to air pressure
83
        s16 Variometer;                                 // climb(+) and sink(-) rate
84
        u16 FlyingTime;                                 // in seconds
85
        u8  UBat;                                       // Battery Voltage in 0.1 Volts
86
        u16 GroundSpeed;                                // speed over ground in cm/s (2D)
87
        s16 Heading;                                    // current flight direction in ° as angle to north
88
        s16 CompassHeading;                         	// current compass value in °
89
        s8  AngleNick;                              	// current Nick angle in 1°
90
        s8  AngleRoll;                                  // current Rick angle in 1°
91
        u8  RC_Quality;                                 // RC_Quality
92
        u8  MKFlags;                                    // Flags from FC
93
        u8  NCFlags;                                    // Flags from NC
94
        u8  Errorcode;                                  // 0 --> okay
95
        u8  OperatingRadius;                    	// current operation radius around the Home Position in m
96
        s16 TopSpeed;                                   // velocity in vertical direction in cm/s
97
        u8  TargetHoldTime;                             // time in s to stay at the given target, counts down to 0 if target has been reached
98
        u8  RC_RSSI;                                    // Receiver signal strength (since version 2 added)
99
        s16 SetpointAltitude;                   	// setpoint for altitude
100
        u8  Gas;                                        // for future use
101
} __attribute__((packed)) NaviData_t;
331 cascade 102
103
 
104
 * MikroKopter Flags
105
 * taken from
407 cascade 106
 * http://svn.mikrokopter.de/mikrowebsvn/filedetails.php?repname=FlightCtrl&path=%2Ftags%2FV0.73d%2Ffc.h
107
 */
331 cascade 108
#define FLAG_MOTOR_RUN  1
109
#define FLAG_FLY        2
110
#define FLAG_CALIBRATE  4
111
#define FLAG_START      8
112
407 cascade 113
 
114
 * NaviCtrl Flags
115
 * taken from
116
 * http://mikrocontroller.cco-ev.de/mikrowebsvn/filedetails.php?repname=NaviCtrl&path=%2Ftags%2FV0.17e%2Fuart1.h
675 cascade 117
 */
407 cascade 118
#define NC_FLAG_FREE			0x01
119
#define NC_FLAG_PH				0x02
120
#define NC_FLAG_CH				0x04
121
#define NC_FLAG_RANGE_LIMIT		0x08
122
#define NC_FLAG_NOSERIALLINK	0x10
123
#define NC_FLAG_TARGET_REACHED	0x20
124
#define NC_FLAG_MANUAL_CONTROL	0x40
125
#define NC_FLAG_8				0x80
126
127
 
128