Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
886 | killagreg | 1 | #ifndef _UBX_H |
2 | #define _UBX_H |
||
3 | |||
4 | #include <inttypes.h> |
||
5 | |||
6 | #define INVALID 0x00 |
||
7 | #define VALID 0x01 |
||
8 | #define PROCESSED 0x02 |
||
9 | |||
10 | |||
11 | #define SATFIX_NONE 0x00 |
||
12 | #define SATFIX_DEADRECKOING 0x01 |
||
13 | #define SATFIX_2D 0x02 |
||
14 | #define SATFIX_3D 0x03 |
||
15 | #define SATFIX_GPS_DEADRECKOING 0x04 |
||
16 | #define SATFIX_TIMEONLY 0x05 |
||
17 | |||
18 | |||
19 | /* enable the UBX protocol at the gps receiver with the following messages enabled |
||
20 | 01-02 NAV - POSLLH |
||
21 | 01-06 Nav - SOL |
||
22 | 01-12 NAV - VELNED */ |
||
23 | |||
24 | typedef struct |
||
25 | { |
||
26 | uint8_t status; // status of data: invalid | valid |
||
27 | uint8_t satnum; // number of satelites |
||
28 | uint8_t satfix; // type of satfix |
||
29 | int32_t longitude; // in 1e-07 deg |
||
30 | int32_t latitude; // in 1e-07 deg |
||
31 | int32_t altitude; // in mm |
||
32 | uint32_t PAcc; // in cm 3d position accuracy |
||
33 | int32_t velnorth; // in cm/s |
||
34 | int32_t veleast; // in cm/s |
||
35 | int32_t veltop; // in cm/s |
||
36 | uint32_t velground; // 2D ground speed in cm/s |
||
37 | uint32_t VAcc; // in cm/s 3d velocity accuracy |
||
38 | uint32_t updatetime; // ms |
||
39 | } GPS_INFO_t; |
||
40 | |||
41 | //here you will find the current gps info |
||
42 | extern GPS_INFO_t GPSInfo; // measured position (last gps record) |
||
43 | |||
44 | // this variable should be decremted by the application |
||
45 | extern volatile uint8_t GPSTimeout; // is reset to 255 if a new UBX msg was received |
||
46 | |||
47 | // this function should be called within the UART RX ISR |
||
48 | extern void ubx_parser(uint8_t c); |
||
49 | |||
50 | #endif //_UBX_H |