Rev 838 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 838 | Rev 966 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #define _B1(bit) (1 << (bit)) |
1 | #define _B1(bit) (1 << (bit)) |
2 | #define _B0(bit) (0 << (bit)) |
2 | #define _B0(bit) (0 << (bit)) |
3 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) |
3 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) |
4 | #define MAX(a, b) ((a) > (b) ? (a) : (b)) |
4 | #define MAX(a, b) ((a) > (b) ? (a) : (b)) |
Line 5... | Line 5... | ||
5 | 5 | ||
6 | //#define BAUDRATE 129 // = 9600 baud |
6 | //#define BAUDRATE 129// = 9600 baud |
7 | //#define BAUDRATE 64 // = 19200 baud |
7 | //#define BAUDRATE 64// = 19200 baud |
8 | #define BAUDRATE 32 // = 38400 baud |
8 | #define BAUDRATE 32// = 38400 baud |
9 | //#define BAUDRATE 21 // = 57600 baud |
9 | //#define BAUDRATE 21// = 57600 baud |
Line 10... | Line 10... | ||
10 | //#define BAUDRATE 10 // = 115200 baud |
10 | //#define BAUDRATE 10// = 115200 baud |
11 | 11 | ||
12 | #define UBX_NOFIX 0 |
12 | #define UBX_NOFIX 0 |
Line 13... | Line 13... | ||
13 | #define UBX_2DFIX 2 |
13 | #define UBX_2DFIX 2 |
14 | #define UBX_3DFIX 3 |
14 | #define UBX_3DFIX 3 |
15 | 15 | ||
16 | #define GPS_EMPTY 0 |
16 | #define GPS_EMPTY 0 |
17 | #define GPS_SYNC1 1 |
17 | #define GPS_SYNC1 1 |
18 | #define GPS_SYNC2 2 |
18 | #define GPS_SYNC2 2 |
19 | #define GPS_CLASS 3 |
19 | #define GPS_CLASS 3 |
20 | #define GPS_LEN1 4 |
20 | #define GPS_LEN1 4 |
21 | #define GPS_LEN2 5 |
21 | #define GPS_LEN2 5 |
Line 22... | Line 22... | ||
22 | #define GPS_FILLING 6 |
22 | #define GPS_FILLING 6 |
23 | #define GPS_CKA 7 |
23 | #define GPS_CKA 7 |
24 | #define GPS_CKB 8 |
24 | #define GPS_CKB 8 |
25 | 25 | ||
26 | /* some uBlox UBX format defines */ |
26 | /* some uBlox UBX format defines */ |
27 | #define SYNC_CHAR1 0xb5 |
27 | #define SYNC_CHAR1 0xb5 |
28 | #define SYNC_CHAR2 0x62 |
28 | #define SYNC_CHAR2 0x62 |
29 | #define CLASS_NAV 0x01 |
29 | #define CLASS_NAV 0x01 |
Line 30... | Line 30... | ||
30 | #define MSGID_POSLLH 0x02 |
30 | #define MSGID_POSLLH 0x02 |
31 | #define MSGID_STATUS 0x03 |
31 | #define MSGID_STATUS 0x03 |
32 | #define MSGID_POSUTM 0x08 |
32 | #define MSGID_POSUTM 0x08 |
33 | #define MSGID_VELNED 0x12 |
33 | #define MSGID_VELNED 0x12 |
34 | 34 | ||
35 | typedef struct { |
35 | typedef struct { |
36 | long north; // in cm (+ = north) |
36 | long north;// in cm (+ = north) |
37 | long east; // in cm (+ = east) |
37 | long east;// in cm (+ = east) |
38 | long altitude; // in cm |
38 | long altitude;// in cm |
39 | long velNorth; |
39 | long velNorth; |
40 | long velEast; |
40 | long velEast; |
41 | long velDown; |
41 | long velDown; |
42 | long groundSpeed; |
42 | long groundSpeed; |
43 | long heading; |
43 | long heading; |
44 | 44 | ||
45 | unsigned long ITOW; |
45 | unsigned long ITOW; |
46 | uint8_t state; // status of data: 0 = invlid; 1 = valid |
46 | uint8_t state;// status of data: 0 = invlid; 1 = valid |
47 | uint8_t noSV; // number of sats |
47 | uint8_t noSV;// number of sats |
48 | } gpsInfo_t; |
48 | } gpsInfo_t; |
49 | 49 | ||
50 | typedef struct { |
50 | typedef struct { |
51 | unsigned long ITOW; // time of week |
51 | unsigned long ITOW;// time of week |
52 | uint8_t GPSfix; // GPSfix Type, range 0..6 |
52 | uint8_t GPSfix;// GPSfix Type, range 0..6 |
53 | uint8_t Flags; // Navigation Status Flags |
53 | uint8_t Flags;// Navigation Status Flags |
54 | uint8_t DiffS; // Differential Status |
54 | uint8_t DiffS;// Differential Status |
Line 55... | Line 55... | ||
55 | uint8_t res; // reserved |
55 | uint8_t res;// reserved |
56 | unsigned long TTFF; // Time to first fix (millisecond time tag) |
56 | unsigned long TTFF;// Time to first fix (millisecond time tag) |
57 | unsigned long MSSS; // Milliseconds since Startup / Reset |
57 | unsigned long MSSS;// Milliseconds since Startup / Reset |
58 | uint8_t packetStatus; |
58 | uint8_t packetStatus; |
59 | } NAV_STATUS_t; |
59 | } NAV_STATUS_t; |
60 | 60 | ||
61 | typedef struct { |
61 | typedef struct { |
62 | unsigned long ITOW; // time of week |
62 | unsigned long ITOW;// time of week |
63 | long LON; // longitude in 1e-07 deg |
63 | long LON;// longitude in 1e-07 deg |
64 | long LAT; // lattitude |
64 | long LAT;// lattitude |
Line 65... | Line 65... | ||
65 | long HEIGHT; // height in mm |
65 | long HEIGHT;// height in mm |
66 | long HMSL; // height above mean sea level im mm |
66 | long HMSL;// height above mean sea level im mm |
67 | unsigned long Hacc; // horizontal accuracy in mm |
67 | unsigned long Hacc;// horizontal accuracy in mm |
68 | unsigned long Vacc; // vertical accuracy in mm |
68 | unsigned long Vacc;// vertical accuracy in mm |
69 | uint8_t packetStatus; |
69 | uint8_t packetStatus; |
70 | } NAV_POSLLH_t; |
70 | } NAV_POSLLH_t; |
71 | 71 | ||
72 | typedef struct { |
72 | typedef struct { |
73 | unsigned long ITOW; // time of week |
73 | unsigned long ITOW;// time of week |
Line 74... | Line 74... | ||
74 | long EAST; // cm UTM Easting |
74 | long EAST; // cm UTM Easting |
75 | long NORTH; // cm UTM Nording |
75 | long NORTH; // cm UTM Nording |
76 | long ALT; // cm altitude |
76 | long ALT;// cm altitude |
77 | uint8_t ZONE; // UTM zone number |
77 | uint8_t ZONE;// UTM zone number |
78 | uint8_t HEM; // Hemisphere Indicator (0=North, 1=South) |
78 | uint8_t HEM;// Hemisphere Indicator (0=North, 1=South) |
79 | uint8_t packetStatus; |
79 | uint8_t packetStatus; |
80 | } NAV_POSUTM_t; |
80 | } NAV_POSUTM_t; |
81 | 81 | ||
82 | typedef struct { |
82 | typedef struct { |
83 | unsigned long ITOW; // ms GPS Millisecond Time of Week |
83 | unsigned long ITOW; // ms GPS Millisecond Time of Week |
84 | long VEL_N; // cm/s NED north velocity |
84 | long VEL_N; // cm/s NED north velocity |
85 | long VEL_E; // cm/s NED east velocity |
85 | long VEL_E; // cm/s NED east velocity |