Subversion Repositories Projects

Rev

Rev 339 | Go to most recent revision | Details | 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
 
41
/*
42
 * NaviCtrl OSD Structs
43
 * portions taken and adapted from
44
 * http://svn.mikrokopter.de/mikrowebsvn/filedetails.php?repname=NaviCtrl&path=%2Ftags%2FV0.14e%2Fuart1.h
45
 */
46
typedef struct {
47
    s32 Longitude; // in 1E-7 deg
48
    s32 Latitude; // in 1E-7 deg
49
    s32 Altitude; // in mm
50
    u8 Status; // validity of data
51
} __attribute__((packed)) GPS_Pos_t;
52
 
53
typedef struct {
54
    s16 Distance; // distance to target in cm
55
    s16 Bearing; // course to target in deg
56
} __attribute__((packed)) GPS_PosDev_t;
57
 
58
typedef struct {
59
    GPS_Pos_t CurrentPosition; // see ubx.h for details
60
    GPS_Pos_t TargetPosition;
61
    GPS_PosDev_t TargetPositionDeviation;
62
    GPS_Pos_t HomePosition;
63
    GPS_PosDev_t HomePositionDeviation;
64
    u8 WaypointIndex; // index of current waypoints running from 0 to WaypointNumber-1
65
    u8 WaypointNumber; // number of stored waypoints
66
    u8 SatsInUse; // no of satellites used for position solution
67
    s16 Altimeter; // hight according to air pressure
68
    s16 Variometer; // climb(+) and sink(-) rate
69
    u16 FlyingTime; // in seconds
70
    u8 UBat; // Battery Voltage in 0.1 Volts
71
    u16 GroundSpeed; // speed over ground in cm/s (2D)
72
    s16 Heading; // current flight direction in deg as angle to north
73
    s16 CompassHeading; // current compass value
74
    s8 AngleNick; // current Nick angle in 1
75
    s8 AngleRoll; // current Rick angle in 1
76
    u8 RC_Quality; // RC_Quality
77
    u8 MKFlags; // Flags from FC
78
    u8 NCFlags; // Flags from NC
79
    u8 Errorcode; // 0 --> okay
80
    u8 OperatingRadius; // current operation radius around the Home Position in m
81
    u8 Reserve[7]; // for future use
82
} __attribute__((packed)) NaviData_t;
83
 
84
/*
85
 * MikroKopter Flags
86
 * portions taken and adapted from
87
 * http://svn.mikrokopter.de/mikrowebsvn/filedetails.php?repname=FlightCtrl&path=%2Ftags%2FV0.72p%2Fuart.h
88
 */
89
#define NC_FLAG_FREE                    1
90
#define NC_FLAG_PH                      2
91
#define NC_FLAG_CH                      4
92
#define NC_FLAG_RANGE_LIMIT             8
93
#define NC_SERIAL_LINK_OK               16
94
#define NC_FLAG_TARGET_REACHED          32
95
 
96
#define FLAG_MOTOR_RUN  1
97
#define FLAG_FLY        2
98
#define FLAG_CALIBRATE  4
99
#define FLAG_START      8