Subversion Repositories Projects

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

#ifndef _MK_H_
#define _MK_H_

// Orginal H&I MK-Software
typedef struct {
        int32_t                  Longitude;                                                                     // in 1E-7 deg
        int32_t                  Latitude;                                                                      // in 1E-7 deg
        int32_t                  Altitude;                                                                      // in mm
        uint8_t                  Status;                                                                                // validity of data
} __attribute__((packed)) GPS_Pos_t;


typedef struct {
        uint16_t                 Distance;                                                                      // distance to target in dm
        int16_t                  Bearing;                                                                               // course to target in deg
} __attribute__((packed)) GPS_PosDev_t;


#define FC_FLAG_MOTOR_RUN                               0x01
#define FC_FLAG_FLY                                                     0x02
#define FC_FLAG_CALIBRATE                               0x04
#define FC_FLAG_MOTOR_START                     0x08

#define NC_FLAG_GPS_OK                                  0x80

typedef struct {
        uint8_t                  Version;                                                                               // version of the data structure
        GPS_Pos_t                CurrentPosition;                                               // see ubx.h for details
        GPS_Pos_t                TargetPosition;
        GPS_PosDev_t TargetPositionDeviation;
        GPS_Pos_t                HomePosition;
        GPS_PosDev_t HomePositionDeviation;
        uint8_t                  WaypointIndex;                                                 // index of current waypoints running from 0 to WaypointNumber-1
        uint8_t                  WaypointNumber;                                                // number of stored waypoints
        uint8_t                  SatsInUse;                                                                     // number of satellites used for position solution
        int16_t                  Altimeter;                                                             // hight according to air pressure
        int16_t                  Variometer;                                                            // climb(+) and sink(-) rate
        uint16_t                 FlyingTime;                                                            // in seconds
        uint8_t                  UBat;                                                                                  // Battery Voltage in 0.1 Volts
        uint16_t                 GroundSpeed;                                                           // speed over ground in cm/s (2D)
        int16_t                  Heading;                                                                               // current flight direction in ° as angle to north
        int16_t                  CompassHeading;                                                // current compass value in °
        int8_t                   AngleNick;                                                                     // current Nick angle in 1°
        int8_t                   AngleRoll;                                                                     // current Rick angle in 1°
        uint8_t                  RC_Quality;                                                            // RC_Quality
        uint8_t                  FCStatusFlags;                                                 // Flags from FC
        uint8_t                  NCFlags;                                                                               // Flags from NC
        uint8_t                  Errorcode;                                                                     // 0 --> okay
        uint8_t                  OperatingRadius;                                               // current operation radius around the Home Position in m
        int16_t                  TopSpeed;                                                                      // velocity in vertical direction in cm/s
        uint8_t                  TargetHoldTime;                                                // time in s to stay at the given target, counts down to 0 if target has been reached
        uint8_t                  RC_RSSI;                                                                               // Receiver signal strength (since version 2 added)
        int16_t                  SetpointAltitude;                                      // setpoint for altitude
        uint8_t                  Gas;                                                                                           // for future use
        uint16_t                 Current;                                                                               // actual current in 0.1A steps
        uint16_t                 UsedCapacity;                                                  // used capacity in mAh
} __attribute__((packed)) NaviData_t;

#endif