Subversion Repositories NaviCtrl

Rev

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

Rev 244 Rev 245
Line 1... Line 1...
1
#ifndef __UBX_H
1
#ifndef __UBX_H
2
#define __UBX_H
2
#define __UBX_H
-
 
3
#include "buffer.h"
Line 3... Line 4...
3
 
4
 
4
// Satfix types for GPSData.SatFix
5
// Satfix types for GPSData.SatFix
5
#define SATFIX_NONE                             0x00
6
#define SATFIX_NONE                             0x00
6
#define SATFIX_DEADRECKOING             0x01
7
#define SATFIX_DEADRECKOING             0x01
Line 16... Line 17...
16
 
17
 
17
#define INVALID         0x00
18
#define INVALID         0x00
18
#define NEWDATA         0x01
19
#define NEWDATA         0x01
Line -... Line 20...
-
 
20
#define PROCESSED       0x02
-
 
21
 
19
#define PROCESSED       0x02
22
#define UBX_CLASS_CFG   0x06
20
 
23
 
21
typedef struct
24
typedef struct
22
{
25
{
23
        s32 Longitude;  // in 1E-7 deg
26
        s32 Longitude;  // in 1E-7 deg
Line 45... Line 48...
45
} __attribute__((packed)) gps_data_t;
48
} __attribute__((packed)) gps_data_t;
Line 46... Line 49...
46
 
49
 
47
// The data are valid if the GPSData.Status is NEWDATA or PROCESSED.
50
// The data are valid if the GPSData.Status is NEWDATA or PROCESSED.
48
// To achieve new data after reading the GPSData.Status should be set to PROCESSED.
51
// To achieve new data after reading the GPSData.Status should be set to PROCESSED.
-
 
52
extern gps_data_t  GPSData;
-
 
53
 
-
 
54
typedef struct
-
 
55
{
-
 
56
        u8 Ack;                                 // 1: msg acknowledged, 0: not acknowledged
-
 
57
        u8 clsID;                               // the msg class
-
 
58
        u8 msgID;                           // the msg id
-
 
59
        u8 Status;                              // invalid/newdata/processed    
-
 
60
} __attribute__((packed)) ubx_ack_t;
-
 
61
extern volatile ubx_ack_t UbxAck;
49
extern gps_data_t  GPSData;
62
 
Line 50... Line 63...
50
extern u32 UBX_Timeout;
63
extern u32 UBX_Timeout;
51
 
64
 
-
 
65
void UBX_Init(void);
Line 52... Line 66...
52
void UBX_Init(void);
66
void UBX_RxParser(u8 c);