Adafruit GPS Library
NMEA_data.h
Go to the documentation of this file.
1 /**************************************************************************/
5 /**************************************************************************/
6 #ifndef _NMEA_DATA_H
7 #define _NMEA_DATA_H
8 #include "Arduino.h"
9 
10 #define NMEA_MAX_WP_ID \
11  20
12 #define NMEA_MAX_SENTENCE_ID \
13  20
14 #define NMEA_MAX_SOURCE_ID \
15  3
16 
17 /*************************************************************************
18  doubles and floats are identical on AVR processors like the UNO where space
19  is tight. doubles avoid the roundoff errors that led to the fixed point mods
20  in https://github.com/adafruit/Adafruit-GPS-Library/pull/13, provided the
21  processor supports actual doubles like the SAMD series with more storage. The
22  total penalty for going all double is under a few hundred bytes / instance or
23  0 bytes / instance on an UNO. This typedef allows a switch to lower precision
24  to save some storage if needed. A float carries 23 bits of fractional
25  resolution, giving a resolution of at least 9 significant digits, thus 6
26  significant digits in the decimal place of an angular value like latitude, and
27  thus a resolution on earth of at least 110 mm. That's closer than GPS will
28  hit, and closer than needed for navigation, so floats can be used to save a
29  little storage.
30  **************************************************************************/
31 #ifndef NMEA_FLOAT_T
32 #define NMEA_FLOAT_T float
33 #endif
34 typedef NMEA_FLOAT_T
36 
37 /**************************************************************************/
51 typedef struct {
52  int16_t *data = NULL;
53  unsigned n = 0;
54  uint32_t lastHistory = 0;
55  uint16_t historyInterval = 20;
56  nmea_float_t scale = 1.0;
57  nmea_float_t offset = 0.0;
59 
60 /**************************************************************************/
70 /**************************************************************************/
71 typedef enum {
77  11,
80  12,
81  NMEA_DDMM = 20,
83  NMEA_HHMMSS =
85  30
87 
88 /**************************************************************************/
95 /**************************************************************************/
96 typedef struct {
97  nmea_float_t latest = 0.0;
98  nmea_float_t smoothed =
99  0.0;
100  uint32_t lastUpdate = 0;
101  uint16_t response = 1000;
104  byte ockam = 0;
105  nmea_history_t *hist = NULL;
106  char *label = NULL;
107  char *unit = NULL;
108  char *fmt = NULL;
110 
111 /**************************************************************************/
120 /**************************************************************************/
121 typedef enum {
122  NMEA_HDOP = 0,
133  NMEA_DISTWP,
147  NMEA_VMGWP,
160  NMEA_DEPTH,
176  NMEA_USR_00,
180  NMEA_USR_03,
181  NMEA_USR_04,
182  NMEA_USR_05,
183  NMEA_USR_06,
184  NMEA_USR_07,
185  NMEA_USR_08,
186  NMEA_USR_09,
187  NMEA_USR_10,
188  NMEA_USR_11,
189  NMEA_USR_12,
191 } nmea_index_t;
193 
194 #endif // _NMEA_DATA_H
Definition: NMEA_data.h:51
temperature of motor 1 in C
Definition: NMEA_data.h:163
Definition: NMEA_data.h:175
true heading, 0 to 360 degrees true
Definition: NMEA_data.h:154
Course over ground to the waypoint, 0 to 360 degrees true.
Definition: NMEA_data.h:131
velocity made good relative to the waypoint, knots
Definition: NMEA_data.h:148
Speed over Ground in knots.
Definition: NMEA_data.h:127
Definition: NMEA_data.h:82
Definition: NMEA_data.h:159
pressure of motor 1 in kPa
Definition: NMEA_data.h:164
Longitude in signed decimal degrees -180 to 180.
Definition: NMEA_data.h:124
Latitude in signed decimal degrees -90 to 90.
Definition: NMEA_data.h:123
current of motor 1 in Amps
Definition: NMEA_data.h:166
sine of true heading
Definition: NMEA_data.h:155
Waypoint Latitude in signed decimal degrees -90 to 90.
Definition: NMEA_data.h:125
#define NMEA_FLOAT_T
let float be overidden on command line
Definition: NMEA_data.h:32
Definition: NMEA_data.h:76
Definition: NMEA_data.h:79
cosine of magnetic heading
Definition: NMEA_data.h:153
sine of magnetic heading
Definition: NMEA_data.h:152
Definition: NMEA_data.h:146
Definition: NMEA_data.h:96
rpm of motor 1
Definition: NMEA_data.h:162
sine of apparent wind angle relative to the boat
Definition: NMEA_data.h:136
apparent wind angle relative to the boat -180 to 180 degrees
Definition: NMEA_data.h:135
rpm of motor 2
Definition: NMEA_data.h:167
cosine of true wind angle relative to the boat
Definition: NMEA_data.h:141
true wind compass direction, magnetic 0 to 360 degrees magnetic
Definition: NMEA_data.h:142
Definition: NMEA_data.h:74
cosine of true heading
Definition: NMEA_data.h:156
cosine of true wind compass direction, magnetic
Definition: NMEA_data.h:144
Course over ground, 0 to 360 degrees true.
Definition: NMEA_data.h:128
true wind speed in knots TWS
Definition: NMEA_data.h:145
outside relative humidity in %
Definition: NMEA_data.h:174
Definition: NMEA_data.h:190
spaces for a user sketch to inject its own data
Definition: NMEA_data.h:179
Boat speed through the water in knots.
Definition: NMEA_data.h:157
temperature of motor 2 in C
Definition: NMEA_data.h:168
Waypoint Longitude in signed decimal degrees -180 to 180.
Definition: NMEA_data.h:126
Distance logged through the water in nautical miles.
Definition: NMEA_data.h:158
boat heel angle, -180 to 180 degrees to starboard
Definition: NMEA_data.h:149
true wind angle relative to the boat -180 to 180 degrees
Definition: NMEA_data.h:139
cosine of apparent wind angle relative to the boat
Definition: NMEA_data.h:137
spaces for a user sketch to inject its own data
Definition: NMEA_data.h:178
voltage of motor 1 in Volts
Definition: NMEA_data.h:165
Definition: NMEA_data.h:132
magnetic heading, 0 to 360 degrees magnetic
Definition: NMEA_data.h:151
sine of Course over ground
Definition: NMEA_data.h:129
cosine of Course over ground
Definition: NMEA_data.h:130
sine of true wind compass direction, magnetic
Definition: NMEA_data.h:143
nmea_index_t
Definition: NMEA_data.h:121
voltage of motor 2 in Volts
Definition: NMEA_data.h:170
sea water temperature in C
Definition: NMEA_data.h:173
current of motor 2 in Amps
Definition: NMEA_data.h:171
depth of water below the surface in metres
Definition: NMEA_data.h:161
Distance to the waypoint in nautical miles.
Definition: NMEA_data.h:134
spaces for a user sketch to inject its own data
Definition: NMEA_data.h:177
boat pitch angle, -180 to 180 degrees bow up
Definition: NMEA_data.h:150
sine of true wind angle relative to the boat
Definition: NMEA_data.h:140
A compass style angle from 0 to 360 degrees.
Definition: NMEA_data.h:73
outside temperature in C
Definition: NMEA_data.h:172
nmea_value_type_t
Definition: NMEA_data.h:71
apparent wind speed, will be coerced to knots
Definition: NMEA_data.h:138
pressure of motor 2 in kPa
Definition: NMEA_data.h:169
Horizontal Dilution of Position.
Definition: NMEA_data.h:122
A simple floating point number.
Definition: NMEA_data.h:72
NMEA_FLOAT_T nmea_float_t
the type of variables to use for floating point
Definition: NMEA_data.h:35
A time stored in HHMMSS format like it comes in from the GPS.
Definition: NMEA_data.h:84