Subversion Repositories Projects

Rev

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

Rev 231 Rev 274
Line 2... Line 2...
2
#define _UBX_H
2
#define _UBX_H
Line 3... Line 3...
3
 
3
 
Line 4... Line -...
4
#include <inttypes.h>
-
 
5
 
-
 
6
 
-
 
7
typedef enum
-
 
8
{
-
 
9
        INVALID,
-
 
10
        NEWDATA,
-
 
11
        PROCESSED
4
#include <inttypes.h>
12
} Status_t;
5
 
13
 
6
 
14
// Satfix types for GPSData.satfix
7
// Satfix types for GPSData.SatFix
15
#define SATFIX_NONE                      0x00
8
#define SATFIX_NONE                             0x00
16
#define SATFIX_DEADRECKOING      0x01
9
#define SATFIX_DEADRECKOING             0x01
17
#define SATFIX_2D                                0x02
10
#define SATFIX_2D                               0x02
18
#define SATFIX_3D                                0x03
11
#define SATFIX_3D                               0x03
19
#define SATFIX_GPS_DEADRECKOING  0x04
12
#define SATFIX_GPS_DEADRECKOING 0x04
20
#define SATFIX_TIMEONLY                  0x05
13
#define SATFIX_TIMEONLY                 0x05
21
// Flags for interpretation of the GPSData.flags
14
// Flags for interpretation of the GPSData.Flags
22
#define FLAG_GPSFIXOK                   0x01 // (i.e. within DOP & ACC Masks)
15
#define FLAG_GPSFIXOK                   0x01 // (i.e. within DOP & ACC Masks)
Line -... Line 16...
-
 
16
#define FLAG_DIFFSOLN                   0x02 // (is DGPS used)
-
 
17
#define FLAG_WKNSET                             0x04 // (is Week Number valid)
-
 
18
#define FLAG_TOWSET                             0x08 // (is Time of Week valid)
-
 
19
 
-
 
20
#define INVALID         0x00
-
 
21
#define NEWDATA         0x01
-
 
22
#define PROCESSED       0x02
-
 
23
 
-
 
24
typedef struct
-
 
25
{
-
 
26
        int32_t Longitude;  // in 1E-7 deg
Line 23... Line -...
23
#define FLAG_DIFFSOLN                   0x02 // (is DGPS used)
-
 
24
#define FLAG_WKNSET                             0x04 // (is Week Number valid)
-
 
25
#define FLAG_TOWSET                             0x08 // (is Time of Week valid)
-
 
26
 
-
 
Line 27... Line 27...
27
 
27
        int32_t Latitude;       // in 1E-7 deg
28
/* enable the UBX protocol at the gps receiver with the following messages enabled
28
        int32_t Altitude;       // in mm
-
 
29
        uint8_t Status;         // validity of data
29
  01-02 NAV - POSLLH
30
} __attribute__((packed)) GPS_Pos_t;
30
  01-06 Nav - SOL
31
 
31
  01-12 NAV - VELNED */
32
 
32
 
-
 
33
typedef struct
-
 
34
{
-
 
35
        uint8_t         flags;          // flags
33
typedef struct
36
        uint8_t         satnum;         // number of satelites
34
{
37
        uint8_t         satfix;         // type of satfix
35
        GPS_Pos_t       Position;       // Lat/Lon/Alt
38
        int32_t         longitude;  // in 1e-07 deg
36
        uint8_t         Flags;                  // Status Flags
39
        int32_t         latitude;       // in 1e-07 deg
37
        uint8_t         NumOfSats;              // number of satelites
-
 
38
        uint8_t         SatFix;                 // type of satfix
40
        int32_t         altitude;   // in mm
39
        uint32_t        Position_Accuracy;      // in cm 3d position accuracy
41
        uint32_t    PAcc;               // in cm 3d position accuracy
40
        int32_t         Speed_North;    // in cm/s
42
        int32_t         velnorth;       // in cm/s
41
        int32_t         Speed_East;             // in cm/s
43
        int32_t         veleast;        // in cm/s
42
        int32_t         Speed_Top;              // in cm/s
44
        int32_t         veltop;     // in cm/s
43
        uint32_t        Speed_Ground;   // 2D ground speed in cm/s
45
        uint32_t    velground;  // 2D ground speed in cm/s
44
        int32_t         Heading;                // 1e-05 deg  Heading 2-D (curent flight direction)
-
 
45
        uint32_t        Speed_Accuracy; // in cm/s 3d velocity accuracy
-
 
46
        uint8_t         Status;                 // status of data
Line 46... Line 47...
46
        uint32_t        VAcc;           // in cm/s 3d velocity accuracy
47
} __attribute__((packed)) gps_data_t;
47
        Status_t        status;     // status of data: invalid | valid
48
 
Line 48... Line -...
48
} GPS_INFO_t;
-
 
49
 
-
 
Line 50... Line 49...
50
//here you will find the current gps info
49
// The data are valid if the GPSData.Status is NEWDATA or PROCESSED.