Rev 1 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | mjames | 1 | /* |
2 | * nmea.h |
||
3 | * |
||
4 | * Created on: 6 Sep 2020 |
||
5 | * Author: mike |
||
6 | */ |
||
7 | |||
8 | #ifndef INC_NMEA_H_ |
||
9 | #define INC_NMEA_H_ |
||
10 | #include <ctype.h> |
||
11 | #include <time.h> |
||
12 | |||
13 | #include "libSerial/serial.h" |
||
14 | |||
15 | #if !defined (__cplusplus) |
||
16 | #if !defined true |
||
17 | #define true 1 |
||
18 | #define false !(true) |
||
19 | #endif |
||
20 | |||
21 | typedef unsigned char bool; |
||
22 | #endif |
||
23 | #ifdef __cplusplus |
||
24 | extern "C" { |
||
25 | #endif |
||
26 | |||
27 | |||
28 | typedef struct |
||
29 | { |
||
30 | char valid; |
||
31 | char time[6]; |
||
32 | char date[8]; |
||
33 | bool good; |
||
34 | char ew; |
||
35 | char ns; |
||
36 | float lat; |
||
37 | float lon; |
||
38 | float heading; |
||
39 | float speed; |
||
40 | struct tm tv; |
||
41 | time_t utc; |
||
42 | } Location; |
||
43 | |||
2 | mjames | 44 | // returns true when it gets an RMC based position |
45 | typedef uint8_t (*nmeaCallback)(uint8_t* buffer, uint16_t cnt); |
||
46 | |||
1 | mjames | 47 | extern bool |
48 | updateLocation (Location *loc , usart_ctl * uc); |
||
49 | |||
2 | mjames | 50 | // set a callback |
51 | extern void setRmcCallback(nmeaCallback callback); |
||
52 | |||
53 | |||
54 | |||
1 | mjames | 55 | #ifdef __cplusplus |
56 | } |
||
57 | #endif |
||
58 | |||
59 | #endif /* INC_NMEA_H_ */ |