Subversion Repositories NaviCtrl


Rev 604 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef __GPS_H
#define __GPS_H

#define SIMULATION_ACTIVE               0x01
#define SIMULATION_MOTOR_ON     0x02

#include "ubx.h"
#include "waypoints.h"

typedef struct
        s16 Nick;
        s16 Roll;
//      s16 Yaw;
}  __attribute__((packed)) GPS_Stick_t;

#define CAM_UPDATE_AZIMUTH              0x01
#define CAM_UPDATE_ELEVATION    0x02

typedef struct
        s16 Azimuth;            // angle in 1 deg measured clockwise from north
        s16 Elevation;          // angle in 0.1 deg measured upwards from horizont
        u8 UpdateMask;
} __attribute__((packed)) CAM_Orientation_t;

extern CAM_Orientation_t CAM_Orientation;
extern Point_t* GPS_pWaypoint;
extern u8 MaxNumberOfWaypoints;    // should be 32
extern u16 AbsoluteFlyingRange_m;    // Maximum distance that the MK is not allowed to exceed - keep zero if not used
extern s16 AbsoluteFlyingAltitude; // Maximum altitude that the MK is not allowed to exceed - keep zero if not used
extern u16 AutoDescendRange_m;
extern GPS_Pos_t SimulationPosition; // the current GPS position in simulated mode
extern GPS_Pos_t GPS_FailsafePosition;         
extern u8 SimulationFlags;
extern u8 MK_FlyingWithGps;

void GPS_Init(void);
void GPS_Navigation(gps_data_t *pGPS_Data, GPS_Stick_t* pGPS_Stick);
void CalcHeadFree(void);
void UBX_Setup(void);


#endif //__GPS_H