This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgps.h
53 lines (44 loc) · 2.58 KB
/
gps.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* MicroChu - High altitude balloon flight software */
/*=======================================================================*/
/* Copyright 2010-2012 Nigel Smart <[email protected]> */
/* And Philip Heron <[email protected]> */
/* Additional Help from Jon Sowman & Adam Greig of Cambridge University */
/* Spaceflight (www.cusf.co.uk) */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, either version 3 of the License, or */
/* (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef __GPS_H__
#define __GPS_H__
#include <stdint.h>
#include "timeout.h"
#define GPS_OK (0)
#define GPS_ERROR (1)
#define GPS_TIMEOUT (2)
#define GPS_BUFFER_FULL (3)
#define GPS_BAD_CRC (4)
#define GPS_NAK (5)
#define GPS_UNEXPECTED (6)
extern void gps_setup(void);
extern void gps_send_packet(uint8_t class, uint8_t id, uint8_t *payload, uint16_t length);
extern int gps_get_packet(uint8_t *class, uint8_t *id, uint8_t *payload, uint16_t *length, to_int timeout);
extern int gps_get_packet_type(uint8_t class, uint8_t id, uint8_t *payload, uint16_t length, to_int timeout);
extern int gps_get_ack(uint8_t class, uint8_t id, to_int timeout);
extern int gps_get_pos(int32_t *lat, int32_t *lon, int32_t *alt);
extern int gps_get_time(uint8_t *hour, uint8_t *minute, uint8_t *second);
extern int gps_get_lock(uint8_t *lock, uint32_t *pacc, uint16_t *pdop, uint8_t *sats);
extern int gps_get_dop(uint32_t *itow, uint16_t *gdop, uint16_t *pdop, uint16_t *tdop,
uint16_t *vdop, uint16_t *hdop, uint16_t *ndop, uint16_t *edop);
extern int gps_set_nav(uint8_t nav);
extern int gps_get_nav(uint8_t *nav);
extern int gps_set_psm(uint8_t psm);
#endif /*__GPS_H__ */