6 /* A GPS position structure. It also contains some information about the number
7 * of seen satellites, the message ID, the date, ...
8 * See App Notes AN0028 p68 */
10 uint8_t msg_id; /* should be A8 */
11 uint8_t mode; /* Quality of fix 0: none, 1: 2D, 2: 3D, 3: 3D+DGNSS */
12 uint8_t sv_num; /* number of SV in fix (0-12) */
14 uint16_t gps_week; /* GNSS week number */
15 uint32_t tow; /* GNSS time of week */
17 int32_t latitude; /* between -90e7 and 90e7, in 1/1e-7 degrees,
18 * positive means north hemisphere */
19 int32_t longitude; /* between -180e7 and 180e7, in 1/1e-7 degrees,
20 * positive means east */
21 uint32_t altitude; /* altitude from elipsoid, in 1/100 meters */
22 uint32_t sea_altitude; /* altitude from sea level, in 1/100 meters */
24 uint16_t gdop; /* Geometric dilution of precision */
25 uint16_t pdop; /* Position dilution of precision */
26 uint16_t hdop; /* Horizontal dilution of precision */
27 uint16_t vdop; /* Vertical dilution of precision */
28 uint16_t tdop; /* Timec dilution of precision */
30 int32_t ecef_x; /* Earth-Centered, Earth-Fixed X pos, 1/100 meters */
31 int32_t ecef_y; /* Earth-Centered, Earth-Fixed Y pos, 1/100 meters */
32 int32_t ecef_z; /* Earth-Centered, Earth-Fixed Z pos, 1/100 meters */
34 int32_t ecef_vx; /* Earth-Centered, Earth-Fixed X speed, 1/100 m/s */
35 int32_t ecef_vy; /* Earth-Centered, Earth-Fixed Y speed, 1/100 m/s */
36 int32_t ecef_vz; /* Earth-Centered, Earth-Fixed Z speed, 1/100 m/s */
38 } __attribute__ ((packed));
40 int gps_venus_init(void);
43 /* does not lock intr, must be done by user */
44 void gps_get_pos(struct gps_pos *pos);
46 static inline int8_t gps_pos_valid(struct gps_pos *pos)
48 /* XXX when a GPS position is valid ? */
49 return (pos->mode >= 2 && pos->sv_num >= 5);