Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit 9fc9c03

Browse files
authoredDec 5, 2020
Merge pull request #155 from sparkfun/release_candidate
Merging release_candidate: updates for v1.8.8
2 parents 97bd455 + 0d34d12 commit 9fc9c03

25 files changed

+6158
-588
lines changed
 

‎.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ Temporary Items
5353
*~
5454
[._]*.un~
5555
*.swp
56+
57+
# Zephyr build files
58+
examples/Zephyr/*/build/*

‎CONTRIBUTING.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
### How to Contribute
1+
# How to Contribute
22

33
Thank you so *much* for offering to help out. We truly appreciate it.
44

55
If you'd like to contribute, start by searching through the [issues](https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/issues) and [pull requests](https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/pulls) to see whether someone else has raised a similar idea or question.
6+
Please check the [closed issues](https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/issues?q=is%3Aissue+is%3Aclosed)
7+
and [closed pull requests](https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/pulls?q=is%3Apr+is%3Aclosed) too - you may find that your issue or feature has already been discussed.
68

79
If you decide to add a feature to this library, please create a PR and follow these best practices:
810

9-
* Change as little as possible. Do not sumbit a PR that changes 100 lines of whitespace. Break up into multiple PRs if necessary.
11+
* Change as little as possible. Do not submit a PR that changes 100 lines of whitespace. Break up into multiple PRs if necessary.
1012
* If you've added a new feature document it with a simple example sketch. This serves both as a test of your PR and as a quick way for users to quickly learn how to use your new feature.
11-
* If you add new functions also add them to keywords.txt so that they are properly highlighted in Arduino. [Read more](https://www.arduino.cc/en/Hacking/libraryTutorial).
13+
* If you add new functions also add them to _keywords.txt_ so that they are properly highlighted in Arduino. [Read more](https://www.arduino.cc/en/Hacking/libraryTutorial).
14+
* **Important:** Please submit your PR using the [release_candidate branch](https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/tree/release_candidate). That way, we can merge and test your PR quickly without changing the _master_ branch
15+
16+
![Contributing.JPG](./img/Contributing.JPG)
1217

1318
## Style guide
1419

‎README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,32 @@ Thanks to:
4848
* [averywallis](https://github.com/averywallis) for adding good comments to the various constants.
4949
* [blazczak](https://github.com/blazczak) and [geeksville](https://github.com/geeksville) for adding support for the series 6 and 7 modules.
5050
* [bjorn@unsurv](https://github.com/unsurv) for adding powerOff and powerOffWithInterrupt.
51+
* [dotMorten](https://github.com/dotMorten) for the MSGOUT keys, autoHPPOSLLH, autoDOP and upgrades to autoPVT.
52+
* [markuckermann](https://github.com/markuckermann) for spotting the config layer gremlins
53+
* [vid553](https://github.com/vid553) for the Zephyr port
54+
* [balamuruganky](https://github.com/balamuruganky) for the NAV-PVT velocity parameters
55+
* [nelarsen](https://github.com/nelarsen) for the buffer overrun improvements
56+
* [mstranne](https://github.com/mstranne) and [shaneperera](https://github.com/shaneperera) for the pushRawData suggestion
57+
* [rubienr](https://github.com/rubienr) for spotting the logical AND issues
5158

5259
Need a Python version for Raspberry Pi? Checkout the [Qwiic Ublox GPS Py module](https://github.com/sparkfun/Qwiic_Ublox_Gps_Py).
5360

5461
Need a library for the Ublox and Particle? Checkout the [Particle library](https://github.com/aseelye/SparkFun_Ublox_Particle_Library) fork.
5562

63+
Contributing
64+
--------------
65+
66+
If you would like to contribute to this library: please do, we truly appreciate it, but please follow [these guidelines](./CONTRIBUTING.md). Thanks!
67+
5668
Repository Contents
5769
-------------------
5870

5971
* **/examples** - Example sketches for the library (.ino). Run these from the Arduino IDE.
6072
* **/src** - Source files for the library (.cpp, .h).
61-
* **keywords.txt** - Keywords from this library that will be highlighted in the Arduino IDE.
62-
* **library.properties** - General library properties for the Arduino package manager.
73+
* **[keywords.txt](./keywords.txt)** - Keywords from this library that will be highlighted in the Arduino IDE.
74+
* **[library.properties](./library.properties)** - General library properties for the Arduino package manager.
75+
* **[CONTRIBUTING.md](./CONTRIBUTING.md)** - Guidelines on how to contribute to this library.
76+
* **[Theory.md](./Theory.md)** - provides detail on how data is processed by the library.
6377

6478
Documentation
6579
--------------

‎Theory.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,21 @@ A method will call **sendCommand()**. This will begin waiting for a response wit
1919

2020
Once **waitForACKResponse()** or **waitForNoACKResponse()** is called the library will start checking the ublox module for new bytes. These bytes may be part of a NMEA sentence, an RTCM sentence, or a UBX packet. The library will file each byte into the appropriate container. Once a given sentence or packet is complete, the appropriate processUBX(), processNMEA() will be called. These functions deal with specific processing for each type.
2121

22-
Note: When interfacing to a ublox module over I2C **checkUbloxI2C()** will read all bytes currently sitting in the I2C buffer. This may pick up multiple UBX packets. For example, an ACK for a VALSET may be mixed in with an auto-PVT response. We cannot tell **checkUbloxI2C()** to stop once a given ACK is found because we run the risk of leaving bytes in the I2C buffer and losing them. We don't have this issue with **checkUbloxSerial()**.
22+
Note: When interfacing to a ublox module over I2C **checkUbloxI2C()** will read all bytes currently sitting in the I2C buffer. This may pick up multiple UBX packets. For example, an ACK for a VALSET may be mixed in with an **AutoPVT** response. We cannot tell **checkUbloxI2C()** to stop once a given ACK is found because we run the risk of leaving unprocessed bytes in the I2C buffer and losing them. We don't have this issue with **checkUbloxSerial()**.
2323

2424
**processUBX()** will check the CRC of the UBX packet. If validated, the packet will be marked as valid. Once a packet is marked as valid then **processUBXpacket()** is called to extract the contents. This is most commonly used to get the position, velocity, and time (PVT) out of the packet but is also used to check the nature of an ACK packet.
2525

26-
Once a packet has been processed, **waitForACKResponse()/waitForNoACKResponse()** makes the appropriate decision what to do with it. If a packet satisfies the CLS/ID and characteristics of what **waitForACKResponse()/waitForNoACKResponse()** is waiting for, then it returns back to sendCommand. If the packet didn't match or was invalid then **waitForACKResponse()/waitForNoACKResponse()** will continue to wait until the correct packet is received or we time out. **sendCommand()** then returns with a value from the **sfe_ublox_status_e** enum depending on the success of **waitForACKResponse()/waitForNoACKResponse()**.
26+
Once a packet has been processed, **waitForACKResponse()/waitForNoACKResponse()** makes the appropriate decision what to do with it. If a packet satisfies the CLS/ID and characteristics of what **waitForACKResponse()/waitForNoACKResponse()** is waiting for, then it returns back to **sendCommand()**. If the packet didn't match or was invalid then **waitForACKResponse()/waitForNoACKResponse()** will continue to wait until the correct packet is received or we time out. **sendCommand()** then returns with a value from the **sfe_ublox_status_e** enum depending on the success of **waitForACKResponse()/waitForNoACKResponse()**.
2727

2828
If we are getting / polling data from the module, **sendCommand()** will return **SFE_UBLOX_STATUS_DATA_RECEIVED** if the get was successful.
2929

3030
If we are setting / writing data to the module, **sendCommand()** will return **SFE_UBLOX_STATUS_DATA_SENT** if the set was successful.
3131

32-
There are circumstances where the library can get the data it is expecting from the module, but it is overwritten (e.g. by an auto-PVT packet) before **sendCommand()** is able to return. In this case, **sendCommand()** will return the error **SFE_UBLOX_STATUS_DATA_OVERWRITTEN**. We should simply call the library function again, but we will need to reset the packet contents first as they will indeed have been overwritten as the error implies.
32+
We are proud that this library still compiles and runs on the original RedBoard (ATmega328P). We achieve that by being very careful about how much RAM we allocate to packet storage. We use only three buffers or containers to store the incoming data:
33+
- **packetBuf** (packetBuffer) - is small and is used to store only the head (and tail) of incoming UBX packets until we know they are. If the packet is _expected_ (i.e. it matches the Class and ID in the packet passed in **sendCommand()**) then the incoming bytes are diverted into **packetCfg** or **packetAck**. Unexpected packets are ignored.
34+
- **packetCfg** (packetConfiguration) - is used to store an _expected_ incoming UBX packet of up to 256 bytes. E.g. **getProtocolVersion()** returns about 220 bytes. Message data requested by a higher function is returned in packetCfg.
35+
- **packetAck** (packetAcknowledge) - is small and is used to store the ACK or NACK accompanying any _expected_ packetCfg.
36+
37+
**AutoPVT**, **AutoHPPOSLLH** and **AutoDOP** packets can arrive at any time. They too _have_ to be stored and processed in **packetCfg**. This means there are circumstances where the library can get the data it is expecting from the module, but it is overwritten (e.g. by an **AutoPVT** packet) before **sendCommand()** is able to return. In this case, **sendCommand()** will return the error **SFE_UBLOX_STATUS_DATA_OVERWRITTEN**. We should simply call the library function again, but we will need to reset the packet contents first as they will indeed have been overwritten as the error implies.
38+
39+
Need a command that is not currently "built-in" to the library? You can do that using a Custom Command. Check out [Example20_SendCustomCommand](https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/blob/master/examples/Example20_SendCustomCommand/Example20_SendCustomCommand.ino) for further details. Note: this will of course increase your RAM use.

‎examples/Example13_PVT/Example1_AutoPVT/Example1_AutoPVT.ino

+26-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,32 @@ void loop()
7878
int PDOP = myGPS.getPDOP();
7979
Serial.print(F(" PDOP: "));
8080
Serial.print(PDOP);
81-
Serial.print(F(" (10^-2)"));
81+
Serial.print(F(" (10^-2)"));
82+
83+
int nedNorthVel = myGPS.getNedNorthVel();
84+
Serial.print(F(" VelN: "));
85+
Serial.print(nedNorthVel);
86+
Serial.print(F(" (mm/s)"));
87+
88+
int nedEastVel = myGPS.getNedEastVel();
89+
Serial.print(F(" VelE: "));
90+
Serial.print(nedEastVel);
91+
Serial.print(F(" (mm/s)"));
92+
93+
int nedDownVel = myGPS.getNedDownVel();
94+
Serial.print(F(" VelD: "));
95+
Serial.print(nedDownVel);
96+
Serial.print(F(" (mm/s)"));
97+
98+
int verticalAccEst = myGPS.getVerticalAccEst();
99+
Serial.print(F(" VAccEst: "));
100+
Serial.print(verticalAccEst);
101+
Serial.print(F(" (mm)"));
102+
103+
int horizontalAccEst = myGPS.getHorizontalAccEst();
104+
Serial.print(F(" HAccEst: "));
105+
Serial.print(horizontalAccEst);
106+
Serial.print(F(" (mm)"));
82107

83108
Serial.println();
84109
} else {

‎examples/Series_6_7/Example1_GetPositionAndTime_Series_6_7/SparkFun_Ublox_Arduino_Library_Series_6_7.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,9 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
899899
switch (msg->cls)
900900
{
901901
case UBX_CLASS_NAV:
902-
if (msg->id == UBX_NAV_PVT && msg->len == 92)
902+
//u-blox8 length == 92
903+
//u-blox7 length == 84
904+
if ((msg->id == UBX_NAV_PVT) && ((msg->len == 92) || (msg->len == 84)))
903905
{
904906
//Parse various byte fields into global vars
905907
constexpr int startingSpot = 0; //fixed value used in processUBX
@@ -915,6 +917,7 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
915917
gpsNanosecond = extractLong(16); //Includes milliseconds
916918

917919
fixType = extractByte(20 - startingSpot);
920+
//Note: the u-blox7 does not support carrSoln. carrierSolution will be zero.
918921
carrierSolution = extractByte(21 - startingSpot) >> 6; //Get 6th&7th bits of this byte
919922
SIV = extractByte(23 - startingSpot);
920923
longitude = extractLong(24 - startingSpot);

‎examples/ZED-F9P/Example11_autoHPPOSLLH/Example11_autoHPPOSLLH.ino renamed to ‎examples/ZED-F9P/Example13_autoHPPOSLLH/Example13_autoHPPOSLLH.ino

+13-12
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ void setup()
4343
Wire.begin();
4444

4545
//myGPS.enableDebugging(); // Uncomment this line to enable lots of helpful debug messages
46+
//myGPS.enableDebugging(Serial, true); // Uncomment this line to enable the minimum of helpful debug messages
4647

4748
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
4849
{
@@ -55,21 +56,21 @@ void setup()
5556

5657
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
5758
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR
58-
59+
5960
myGPS.setNavigationFrequency(1); //Produce one solution per second
60-
61+
6162

6263
// The acid test: all four of these combinations should work seamlessly :-)
63-
64+
6465
//myGPS.setAutoPVT(false); // Library will poll each reading
6566
//myGPS.setAutoHPPOSLLH(false); // Library will poll each reading
66-
67+
6768
//myGPS.setAutoPVT(true); // Tell the GPS to "send" each solution automatically
6869
//myGPS.setAutoHPPOSLLH(false); // Library will poll each reading
6970

7071
//myGPS.setAutoPVT(false); // Library will poll each reading
7172
//myGPS.setAutoHPPOSLLH(true); // Tell the GPS to "send" each hi res solution automatically
72-
73+
7374
myGPS.setAutoPVT(true); // Tell the GPS to "send" each solution automatically
7475
myGPS.setAutoHPPOSLLH(true); // Tell the GPS to "send" each hi res solution automatically
7576
}
@@ -81,31 +82,31 @@ void loop()
8182
if ((myGPS.getHPPOSLLH()) || (myGPS.getPVT()))
8283
{
8384
Serial.println();
84-
85+
8586
long highResLatitude = myGPS.getHighResLatitude();
8687
Serial.print(F("Hi Res Lat: "));
8788
Serial.print(highResLatitude);
88-
89+
8990
int highResLatitudeHp = myGPS.getHighResLatitudeHp();
9091
Serial.print(F(" "));
9192
Serial.print(highResLatitudeHp);
92-
93+
9394
long highResLongitude = myGPS.getHighResLongitude();
9495
Serial.print(F(" Hi Res Long: "));
9596
Serial.print(highResLongitude);
96-
97+
9798
int highResLongitudeHp = myGPS.getHighResLongitudeHp();
9899
Serial.print(F(" "));
99100
Serial.print(highResLongitudeHp);
100-
101+
101102
unsigned long horizAccuracy = myGPS.getHorizontalAccuracy();
102103
Serial.print(F(" Horiz accuracy: "));
103104
Serial.print(horizAccuracy);
104-
105+
105106
long latitude = myGPS.getLatitude();
106107
Serial.print(F(" Lat: "));
107108
Serial.print(latitude);
108-
109+
109110
long longitude = myGPS.getLongitude();
110111
Serial.print(F(" Long: "));
111112
Serial.println(longitude);

‎examples/ZED-F9P/Example3_StartRTCMBase/Example3_StartRTCMBase.ino

+17-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,19 @@
2929
#include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_Ublox_GPS
3030
SFE_UBLOX_GPS myGPS;
3131

32+
//#define USE_SERIAL1 // Uncomment this line to push the RTCM data to Serial1
33+
3234
void setup()
3335
{
3436
Serial.begin(115200);
3537
while (!Serial); //Wait for user to open terminal
3638
Serial.println("Ublox Base station example");
3739

40+
#ifdef USE_SERIAL1
41+
// If our board supports it, we can output the RTCM data on Serial1
42+
Serial1.begin(115200);
43+
#endif
44+
3845
Wire.begin();
3946
Wire.setClock(400000); //Increase I2C clock speed to 400kHz
4047

@@ -44,8 +51,11 @@ void setup()
4451
while (1);
4552
}
4653

54+
// Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate
55+
//myGPS.factoryDefault(); delay(5000);
56+
4757
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
48-
myGPS.saveConfiguration(); //Save the current settings to flash and BBR
58+
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR
4959

5060
while (Serial.available()) Serial.read(); //Clear any latent chars in serial buffer
5161
Serial.println("Press any key to send commands to begin Survey-In");
@@ -153,7 +163,12 @@ void loop()
153163
//Useful for passing the RTCM correction data to a radio, Ntrip broadcaster, etc.
154164
void SFE_UBLOX_GPS::processRTCM(uint8_t incoming)
155165
{
156-
//Let's just pretty-print the HEX values for now
166+
#ifdef USE_SERIAL1
167+
//Push the RTCM data to Serial1
168+
Serial1.write(incoming);
169+
#endif
170+
171+
//Pretty-print the HEX values to Serial
157172
if (myGPS.rtcmFrameCounter % 16 == 0) Serial.println();
158173
Serial.print(" ");
159174
if (incoming < 0x10) Serial.print("0");

‎examples/ZED-F9P/Example5_RelativePositioningInformation/Example5_RelativePositioningInformation.ino

+37-1
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,21 @@
2626
#include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_Ublox_GPS
2727
SFE_UBLOX_GPS myGPS;
2828

29+
//#define USE_SERIAL1 // Uncomment this line to push the RTCM data from Serial1 to the module via I2C
30+
31+
size_t numBytes = 0; // Record the number os bytes received from Serial1
32+
2933
void setup()
3034
{
3135
Serial.begin(115200);
3236
while (!Serial); //Wait for user to open terminal
3337
Serial.println("Ublox Base station example");
3438

39+
#ifdef USE_SERIAL1
40+
// If our board supports it, we can receive the RTCM data on Serial1
41+
Serial1.begin(115200);
42+
#endif
43+
3544
Wire.begin();
3645
Wire.setClock(400000); //Increase I2C clock speed to 400kHz
3746

@@ -40,6 +49,15 @@ void setup()
4049
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
4150
while (1);
4251
}
52+
53+
// Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate
54+
//myGPS.factoryDefault(); delay(5000);
55+
56+
#ifdef USE_SERIAL1
57+
Serial.print(F("Enabling UBX and RTCM input on I2C. Result: "));
58+
Serial.print(myGPS.setPortInput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_RTCM3)); //Enable UBX and RTCM input on I2C
59+
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR
60+
#endif
4361
}
4462

4563
void loop()
@@ -121,5 +139,23 @@ void loop()
121139
else
122140
Serial.println("RELPOS request failed");
123141

124-
delay(4000);
142+
for (int i = 0; i < 500; i++)
143+
{
144+
#ifdef USE_SERIAL1
145+
uint8_t store[256];
146+
while ((Serial1.available()) && (numBytes < 256)) // Check if data has been received
147+
{
148+
store[numBytes++] = Serial1.read(); // Read a byte from Serial1 and store it
149+
}
150+
if (numBytes > 0) // Check if data was received
151+
{
152+
//Serial.print("Pushing ");
153+
//Serial.print(numBytes);
154+
//Serial.println(" bytes via I2C");
155+
myGPS.pushRawData(((uint8_t *)&store), numBytes); // Push the RTCM data via I2C
156+
numBytes = 0; // Reset numBytes
157+
}
158+
#endif
159+
delay(10);
160+
}
125161
}

‎examples/ZED-F9P/Example9_multiSetVal/Example9_multiSetVal.ino

+7-7
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ void setup()
6767
//Original: myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second
6868

6969
//Begin with newCfgValset8/16/32
70-
setValueSuccess &= myGPS.newCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1); //Set output rate of msg 1005 over the I2C port to once per measurement (value is 8-bit (U1))
71-
//setValueSuccess &= myGPS.newCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1, 7); //Set this and the following settings into Flash/RAM/BBR instead of BBR
70+
setValueSuccess &= myGPS.newCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1); //Set output rate of msg 1005 over the I2C port to once per measurement (value is 8-bit (U1))
71+
//setValueSuccess &= myGPS.newCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1, VAL_LAYER_RAM); //Set this and the following settings in RAM only instead of Flash/RAM/BBR
7272
//Add extra keyIDs and values using addCfgValset8/16/32
73-
setValueSuccess &= myGPS.addCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1077_I2C, 1); //Set output rate of msg 1077 over the I2C port to once per measurement (value is 8-bit (U1))
74-
setValueSuccess &= myGPS.addCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1087_I2C, 1); //Set output rate of msg 1087 over the I2C port to once per measurement (value is 8-bit (U1))
75-
setValueSuccess &= myGPS.addCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1127_I2C, 1); //Set output rate of msg 1127 over the I2C port to once per measurement (value is 8-bit (U1))
76-
setValueSuccess &= myGPS.addCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1097_I2C, 1); //Set output rate of msg 1097 over the I2C port to once per measurement (value is 8-bit (U1))
73+
setValueSuccess &= myGPS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1077_I2C, 1); //Set output rate of msg 1077 over the I2C port to once per measurement (value is 8-bit (U1))
74+
setValueSuccess &= myGPS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1087_I2C, 1); //Set output rate of msg 1087 over the I2C port to once per measurement (value is 8-bit (U1))
75+
setValueSuccess &= myGPS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1127_I2C, 1); //Set output rate of msg 1127 over the I2C port to once per measurement (value is 8-bit (U1))
76+
setValueSuccess &= myGPS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1097_I2C, 1); //Set output rate of msg 1097 over the I2C port to once per measurement (value is 8-bit (U1))
7777
// Add the final value and send the packet using sendCfgValset8/16/32
78-
setValueSuccess &= myGPS.sendCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1230_I2C, 10); //Set output rate of msg 1230 over the I2C port to once every 10 measurements (value is 8-bit (U1))
78+
setValueSuccess &= myGPS.sendCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1230_I2C, 10); //Set output rate of msg 1230 over the I2C port to once every 10 measurements (value is 8-bit (U1))
7979

8080
if (setValueSuccess == true)
8181
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
cmake_minimum_required(VERSION 3.13.1)
4+
5+
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
6+
project(sparkfun_ublox_zephyr_library)
7+
8+
zephyr_compile_options(-fdiagnostics-color=always)
9+
10+
zephyr_include_directories(.)
11+
target_sources(app PRIVATE src/SparkFun_Ublox_Zephyr_Library.cpp)
12+
target_sources(app PRIVATE src/SparkFun_Ublox_Zephyr_Interface.cpp)
13+
14+
target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
&i2c0 {
2+
status = "okay";
3+
compatible = "nordic,nrf-twim";
4+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#turn on c++ support
2+
CONFIG_CPLUSPLUS=y
3+
4+
# turn on peripherals
5+
CONFIG_GPIO=y
6+
CONFIG_I2C=y
7+
CONFIG_I2C_0=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/*
2+
This is an interface that connects the CPP Ublox library with the main C code.
3+
Added to make it possible to run Ublox lib on Zephyr (NCS)
4+
5+
This port was made by Vid Rajtmajer <vid@irnas.eu>, www.irnas.eu
6+
*/
7+
#include "SparkFun_Ublox_Zephyr_Interface.h"
8+
9+
#include <errno.h>
10+
#include <stdio.h>
11+
#include <string.h>
12+
#include <time.h>
13+
14+
#include "SparkFun_Ublox_Zephyr_Library.h"
15+
16+
17+
SFE_UBLOX_GPS myGPS; // driver class instance
18+
long lastTime = 0; // Simple local timer. Limits amount if I2C traffic to Ublox module.
19+
20+
// init GPIO checksumFailurePin and load GPIO device pointer to the driver
21+
uint8_t set_gpio_dev(struct device *gpio_dev, uint8_t enable_debug)
22+
{
23+
if (myGPS.init_gpio_pins(*gpio_dev) == false)
24+
{
25+
return -EIO;
26+
}
27+
// turn on debugging if enable_debug is set
28+
if (enable_debug)
29+
{
30+
myGPS.enableDebugging();
31+
}
32+
return 0;
33+
}
34+
35+
// initialize I2C and check if GPS device respons
36+
uint8_t gps_begin(struct device *i2c_dev)
37+
{
38+
if (myGPS.begin(*i2c_dev) == false)
39+
{
40+
return -EIO;
41+
}
42+
return 0;
43+
}
44+
45+
// This will pipe all NMEA sentences to UART so we can see them
46+
void pipe_nmea_sentences(void)
47+
{
48+
myGPS.setNMEAOutputPort();
49+
}
50+
51+
// Check for available bytes from the device
52+
void check_ublox(void)
53+
{
54+
myGPS.checkUblox();
55+
}
56+
57+
// Get position information when requested, also display number of satellites used in the fix
58+
int get_position(void)
59+
{
60+
//Query module only every second. Doing it more often will just cause I2C traffic.
61+
//The module only responds when a new position is available, print it to console
62+
if (k_uptime_get_32() - lastTime > 1000)
63+
{
64+
lastTime = k_uptime_get_32(); //Update the timer
65+
66+
long latitude = myGPS.getLatitude();
67+
long longitude = myGPS.getLongitude();
68+
long altitude = myGPS.getAltitude();
69+
uint8_t SIV = myGPS.getSIV();
70+
71+
printk("Position: Lat: %ld, Lon: %ld, Alt: %ld, SIV: %d", latitude, longitude, altitude, SIV);
72+
return 0;
73+
}
74+
return -EBUSY;
75+
}
76+
77+
// Get date and time information when requested, check if they are valid and print info to console, it returns UNIX time
78+
void get_datetime(void)
79+
{
80+
int year = myGPS.getYear();
81+
int month = myGPS.getMonth();
82+
int day = myGPS.getDay();
83+
int hour = myGPS.getHour();
84+
int minute = myGPS.getMinute();
85+
int second = myGPS.getSecond();
86+
87+
printk("DateTime: %d-%d-%d %d:%d:%d\n", year, month, day, hour, minute, second);
88+
89+
printk("Time is ");
90+
if (myGPS.getTimeValid() == false)
91+
{
92+
printk("not ");
93+
}
94+
printk("valid. Date is ");
95+
if (myGPS.getDateValid() == false)
96+
{
97+
printk("not ");
98+
}
99+
printk("valid.\n");
100+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
This is an interface that connects the CPP Ublox library with the main C code.
3+
Added to make it possible to run Ublox lib on Zephyr (NCS)
4+
5+
This port was made by Vid Rajtmajer <vid@irnas.eu>, www.irnas.eu
6+
*/
7+
#include <time.h>
8+
#include <zephyr.h>
9+
10+
#ifndef _UBLOX_LIB_INTERFACE_H_
11+
#define _UBLOX_LIB_INTERFACE_H_
12+
13+
#ifdef __cplusplus
14+
extern "C" {
15+
#endif
16+
17+
uint8_t set_gpio_dev(struct device *gpio_dev, uint8_t enable_debug); // init GPIO
18+
uint8_t gps_begin(struct device *i2c_dev); // initialize I2C and check if GPS device respons
19+
void pipe_nmea_sentences(void); // print NMEA sentences
20+
21+
void check_ublox(void); // Check for available bytes from the device
22+
int get_position(void); // Get position information
23+
void get_datetime(void); // Get date and time information
24+
25+
#ifdef __cplusplus
26+
}
27+
#endif
28+
29+
#endif //UBLOX_LIB_INTERFACE_H_

‎examples/Zephyr/Example1_GetPositionAndTime_Zephyr/src/SparkFun_Ublox_Zephyr_Library.cpp

+3,492
Large diffs are not rendered by default.

‎examples/Zephyr/Example1_GetPositionAndTime_Zephyr/src/SparkFun_Ublox_Zephyr_Library.h

+901
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/*
2+
Reading lat, long and UTC time via UBX binary commands
3+
By: Nathan Seidle
4+
SparkFun Electronics
5+
Date: August 22nd, 2018
6+
License: MIT. See license file for more information but you can
7+
basically do whatever you want with this code.
8+
9+
This example reads the NMEA setences from the Ublox module over I2c and outputs
10+
them to the serial port
11+
12+
Open the serial monitor at 115200 baud to see the output
13+
I2C clock speed: 100 kHz
14+
15+
Ported to Zephyr by Vid Rajtmajer <vid@irnas.eu>, www.irnas.eu
16+
17+
Development environment specifics: NCS v1.0.3 release
18+
19+
To build: west build -b <BOARD_NAME> -p Can also read NMEA sentences over I2C with check_ublox function
20+
To flash: west flash --erase
21+
*/
22+
#include <device.h>
23+
#include <drivers/i2c.h>
24+
#include <errno.h>
25+
#include <zephyr.h>
26+
#include <zephyr/types.h>
27+
28+
#include "SparkFun_Ublox_Zephyr_Interface.h"
29+
30+
31+
#define I2C_DEV "I2C_0"
32+
33+
struct device *gpio_dev;
34+
struct device *i2c_dev;
35+
/* I2C pins used are defaults for I2C_0 on nrf52840
36+
SDA: 26
37+
SCL: 27
38+
*/
39+
40+
uint8_t init_gpio(void) {
41+
const char* gpioName = "GPIO_0";
42+
gpio_dev = device_get_binding(gpioName);
43+
if (gpio_dev == NULL) {
44+
printk("Error: Could not get %s device\n", gpioName);
45+
return -EIO;
46+
}
47+
int err = set_gpio_dev(gpio_dev, true); // set GPIO_0 device and enable debugging
48+
if (err) {
49+
return -EIO;
50+
}
51+
return 0;
52+
}
53+
54+
uint8_t init_i2c(void) {
55+
i2c_dev = device_get_binding(I2C_DEV);
56+
if (!i2c_dev)
57+
{
58+
printk("I2C_0 error\n");
59+
return -1;
60+
}
61+
else
62+
{
63+
printk("I2C_0 Init OK\n");
64+
return 0;
65+
}
66+
}
67+
68+
uint8_t init_gps(void) {
69+
if (gps_begin(i2c_dev) != 0)
70+
{
71+
printk("Ublox GPS init error!\n");
72+
return -1;
73+
}
74+
return 0;
75+
}
76+
77+
78+
void main(void) {
79+
printk("Zephyr Ublox example\n");
80+
81+
int err;
82+
err = init_gpio();
83+
if (err) {
84+
return;
85+
}
86+
err = init_i2c();
87+
if (err) {
88+
return;
89+
}
90+
91+
err = init_gps();
92+
if (err) {
93+
return;
94+
}
95+
96+
while(1) {
97+
//check_ublox(); // See if new data is available. Process bytes as they come in.
98+
get_position();
99+
get_datetime();
100+
k_msleep(250); // Don't pound too hard on the I2C bus
101+
}
102+
}

‎img/Contributing.JPG

60.7 KB
Loading

‎keywords.txt

+7
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ getGroundSpeed KEYWORD2
5353
getHeading KEYWORD2
5454
getPDOP KEYWORD2
5555
getTimeOfWeek KEYWORD2
56+
getHorizontalAccEst KEYWORD2
57+
getVerticalAccEst KEYWORD2
58+
getNedNorthVel KEYWORD2
59+
getNedEastVel KEYWORD2
60+
getNedDownVel KEYWORD2
5661

5762
setPortOutput KEYWORD2
5863
setPortInput KEYWORD2
@@ -168,6 +173,8 @@ getI2CTransactionSize KEYWORD2
168173

169174
setStaticPosition KEYWORD2
170175

176+
pushRawData KEYWORD2
177+
171178
#######################################
172179
# Constants (LITERAL1)
173180
#######################################

‎library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun u-blox Arduino Library
2-
version=1.8.7
2+
version=1.8.8
33
author=SparkFun Electronics <techsupport@sparkfun.com>
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=Library for I2C and Serial Communication with u-blox modules

‎src/SparkFun_Ublox_Arduino_Library.cpp

+537-93
Large diffs are not rendered by default.

‎src/SparkFun_Ublox_Arduino_Library.h

+92-17
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,6 @@
5252

5353
#include "u-blox_config_keys.h"
5454

55-
// Define Serial for SparkFun SAMD based boards.
56-
// Boards like the RedBoard Turbo use SerialUSB (not Serial).
57-
// But other boards like the SAMD51 Thing Plus use Serial (not SerialUSB).
58-
// The next nine lines let the code compile cleanly on as many SAMD boards as possible.
59-
#if defined(ARDUINO_ARCH_SAMD) // Is this a SAMD board?
60-
#if defined(USB_VID) // Is the USB Vendor ID defined?
61-
#if (USB_VID == 0x1B4F) // Is this a SparkFun board?
62-
#if !defined(ARDUINO_SAMD51_THING_PLUS) & !defined(ARDUINO_SAMD51_MICROMOD) // If it is not a SAMD51 Thing Plus or SAMD51 MicroMod
63-
#define Serial SerialUSB // Define Serial as SerialUSB
64-
#endif
65-
#endif
66-
#endif
67-
#endif
68-
6955
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7056

7157
//Define a digital pin to aid checksum failure capture and analysis
@@ -492,6 +478,7 @@ class SFE_UBLOX_GPS
492478
// The same is true for getHPPOSLLH.
493479
#define getPVTmaxWait 1100 // Default maxWait for getPVT and all functions which call it
494480
#define getHPPOSLLHmaxWait 1100 // Default maxWait for getHPPOSLLH and all functions which call it
481+
#define getDOPmaxWait 1100 // Default maxWait for getDOP and all functions which all it
495482

496483
boolean assumeAutoPVT(boolean enabled, boolean implicitUpdate = true); //In case no config access to the GPS is possible and PVT is send cyclically already
497484
boolean setAutoPVT(boolean enabled, uint16_t maxWait = defaultMaxWait); //Enable/disable automatic PVT reports at the navigation frequency
@@ -501,13 +488,27 @@ class SFE_UBLOX_GPS
501488
boolean setAutoHPPOSLLH(boolean enabled, uint16_t maxWait = defaultMaxWait); //Enable/disable automatic HPPOSLLH reports at the navigation frequency
502489
boolean setAutoHPPOSLLH(boolean enabled, boolean implicitUpdate, uint16_t maxWait = defaultMaxWait); //Enable/disable automatic HPPOSLLH reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
503490
boolean getHPPOSLLH(uint16_t maxWait = getHPPOSLLHmaxWait); //Query module for latest group of datums and load global vars: lat, long, alt, speed, SIV, accuracies, etc. If autoPVT is disabled, performs an explicit poll and waits, if enabled does not block. Returns true if new HPPOSLLH is available.
491+
boolean assumeAutoDOP(boolean enabled, boolean implicitUpdate = true); //In case no config access to the GPS is possible and DOP is send cyclically already
492+
boolean setAutoDOP(boolean enabled, uint16_t maxWait = defaultMaxWait); //Enable/disable automatic DOP reports at the navigation frequency
493+
boolean setAutoDOP(boolean enabled, boolean implicitUpdate, uint16_t maxWait = defaultMaxWait); //Enable/disable automatic DOP reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
494+
boolean getDOP(uint16_t maxWait = getDOPmaxWait); //Query module for latest dilution of precision values and load global vars:. If autoDOP is disabled, performs an explicit poll and waits, if enabled does not block. Returns true if new DOP is available.
504495
void flushPVT(); //Mark all the PVT data as read/stale. This is handy to get data alignment after CRC failure
505496
void flushHPPOSLLH(); //Mark all the PVT data as read/stale. This is handy to get data alignment after CRC failure
497+
void flushDOP(); //Mark all the DOP data as read/stale. This is handy to get data alignment after CRC failure
506498

499+
bool getGnssFixOk(uint16_t maxWait = getPVTmaxWait); //Get whether we have a valid fix (i.e within DOP & accuracy masks)
500+
bool getDiffSoln(uint16_t maxWait = getPVTmaxWait); //Get whether differential corrections were applied
507501
int32_t getLatitude(uint16_t maxWait = getPVTmaxWait); //Returns the current latitude in degrees * 10^-7. Auto selects between HighPrecision and Regular depending on ability of module.
508502
int32_t getLongitude(uint16_t maxWait = getPVTmaxWait); //Returns the current longitude in degrees * 10-7. Auto selects between HighPrecision and Regular depending on ability of module.
509503
int32_t getAltitude(uint16_t maxWait = getPVTmaxWait); //Returns the current altitude in mm above ellipsoid
510504
int32_t getAltitudeMSL(uint16_t maxWait = getPVTmaxWait); //Returns the current altitude in mm above mean sea level
505+
506+
int32_t getHorizontalAccEst(uint16_t maxWait = getPVTmaxWait);
507+
int32_t getVerticalAccEst(uint16_t maxWait = getPVTmaxWait);
508+
int32_t getNedNorthVel(uint16_t maxWait = getPVTmaxWait);
509+
int32_t getNedEastVel(uint16_t maxWait = getPVTmaxWait);
510+
int32_t getNedDownVel(uint16_t maxWait = getPVTmaxWait);
511+
511512
uint8_t getSIV(uint16_t maxWait = getPVTmaxWait); //Returns number of sats used in fix
512513
uint8_t getFixType(uint16_t maxWait = getPVTmaxWait); //Returns the type of fix: 0=no, 3=3D, 4=GNSS+Deadreckoning
513514
uint8_t getCarrierSolutionType(uint16_t maxWait = getPVTmaxWait); //Returns RTK solution: 0=no, 1=float solution, 2=fixed solution
@@ -538,6 +539,14 @@ class SFE_UBLOX_GPS
538539
uint32_t getHorizontalAccuracy(uint16_t maxWait = getHPPOSLLHmaxWait);
539540
uint32_t getVerticalAccuracy(uint16_t maxWait = getHPPOSLLHmaxWait);
540541

542+
uint16_t getGeometricDOP(uint16_t maxWait = getDOPmaxWait);
543+
uint16_t getPositionDOP(uint16_t maxWait = getDOPmaxWait);
544+
uint16_t getTimeDOP(uint16_t maxWait = getDOPmaxWait);
545+
uint16_t getVerticalDOP(uint16_t maxWait = getDOPmaxWait);
546+
uint16_t getHorizontalDOP(uint16_t maxWait = getDOPmaxWait);
547+
uint16_t getNorthingDOP(uint16_t maxWait = getDOPmaxWait);
548+
uint16_t getEastingDOP(uint16_t maxWait = getDOPmaxWait);
549+
541550
//Port configurations
542551
boolean setPortOutput(uint8_t portID, uint8_t comSettings, uint16_t maxWait = defaultMaxWait); //Configure a given port to output UBX, NMEA, RTCM3 or a combination thereof
543552
boolean setPortInput(uint8_t portID, uint8_t comSettings, uint16_t maxWait = defaultMaxWait); //Configure a given port to input UBX, NMEA, RTCM3 or a combination thereof
@@ -574,9 +583,9 @@ class SFE_UBLOX_GPS
574583
uint8_t setVal8(uint32_t keyID, uint8_t value, uint8_t layer = VAL_LAYER_ALL, uint16_t maxWait = 250); //Sets the 8-bit value at a given group/id/size location
575584
uint8_t setVal16(uint32_t keyID, uint16_t value, uint8_t layer = VAL_LAYER_ALL, uint16_t maxWait = 250); //Sets the 16-bit value at a given group/id/size location
576585
uint8_t setVal32(uint32_t keyID, uint32_t value, uint8_t layer = VAL_LAYER_ALL, uint16_t maxWait = 250); //Sets the 32-bit value at a given group/id/size location
577-
uint8_t newCfgValset8(uint32_t keyID, uint8_t value, uint8_t layer = VAL_LAYER_BBR); //Define a new UBX-CFG-VALSET with the given KeyID and 8-bit value
578-
uint8_t newCfgValset16(uint32_t keyID, uint16_t value, uint8_t layer = VAL_LAYER_BBR); //Define a new UBX-CFG-VALSET with the given KeyID and 16-bit value
579-
uint8_t newCfgValset32(uint32_t keyID, uint32_t value, uint8_t layer = VAL_LAYER_BBR); //Define a new UBX-CFG-VALSET with the given KeyID and 32-bit value
586+
uint8_t newCfgValset8(uint32_t keyID, uint8_t value, uint8_t layer = VAL_LAYER_ALL); //Define a new UBX-CFG-VALSET with the given KeyID and 8-bit value
587+
uint8_t newCfgValset16(uint32_t keyID, uint16_t value, uint8_t layer = VAL_LAYER_ALL); //Define a new UBX-CFG-VALSET with the given KeyID and 16-bit value
588+
uint8_t newCfgValset32(uint32_t keyID, uint32_t value, uint8_t layer = VAL_LAYER_ALL); //Define a new UBX-CFG-VALSET with the given KeyID and 32-bit value
580589
uint8_t addCfgValset8(uint32_t keyID, uint8_t value); //Add a new KeyID and 8-bit value to an existing UBX-CFG-VALSET ubxPacket
581590
uint8_t addCfgValset16(uint32_t keyID, uint16_t value); //Add a new KeyID and 16-bit value to an existing UBX-CFG-VALSET ubxPacket
582591
uint8_t addCfgValset32(uint32_t keyID, uint32_t value); //Add a new KeyID and 32-bit value to an existing UBX-CFG-VALSET ubxPacket
@@ -601,7 +610,28 @@ class SFE_UBLOX_GPS
601610

602611
boolean getRELPOSNED(uint16_t maxWait = 1100); //Get Relative Positioning Information of the NED frame
603612

613+
// Enable debug messages using the chosen Serial port (Stream)
614+
// Boards like the RedBoard Turbo use SerialUSB (not Serial).
615+
// But other boards like the SAMD51 Thing Plus use Serial (not SerialUSB).
616+
// These lines let the code compile cleanly on as many SAMD boards as possible.
617+
#if defined(ARDUINO_ARCH_SAMD) // Is this a SAMD board?
618+
#if defined(USB_VID) // Is the USB Vendor ID defined?
619+
#if (USB_VID == 0x1B4F) // Is this a SparkFun board?
620+
#if !defined(ARDUINO_SAMD51_THING_PLUS) & !defined(ARDUINO_SAMD51_MICROMOD) // If it is not a SAMD51 Thing Plus or SAMD51 MicroMod
621+
void enableDebugging(Stream &debugPort = SerialUSB, boolean printLimitedDebug = false); //Given a port to print to, enable debug messages. Default to all, not limited.
622+
#else
623+
void enableDebugging(Stream &debugPort = Serial, boolean printLimitedDebug = false); //Given a port to print to, enable debug messages. Default to all, not limited.
624+
#endif
625+
#else
626+
void enableDebugging(Stream &debugPort = Serial, boolean printLimitedDebug = false); //Given a port to print to, enable debug messages. Default to all, not limited.
627+
#endif
628+
#else
604629
void enableDebugging(Stream &debugPort = Serial, boolean printLimitedDebug = false); //Given a port to print to, enable debug messages. Default to all, not limited.
630+
#endif
631+
#else
632+
void enableDebugging(Stream &debugPort = Serial, boolean printLimitedDebug = false); //Given a port to print to, enable debug messages. Default to all, not limited.
633+
#endif
634+
605635
void disableDebugging(void); //Turn off debug statements
606636
void debugPrint(char *message); //Safely print debug statements
607637
void debugPrintln(char *message); //Safely print debug statements
@@ -636,6 +666,10 @@ class SFE_UBLOX_GPS
636666
bool setStaticPosition(int32_t ecefXOrLat, int8_t ecefXOrLatHP, int32_t ecefYOrLon, int8_t ecefYOrLonHP, int32_t ecefZOrAlt, int8_t ecefZOrAltHP, bool latLong = false, uint16_t maxWait = 250);
637667
bool setStaticPosition(int32_t ecefXOrLat, int32_t ecefYOrLon, int32_t ecefZOrAlt, bool latLong = false, uint16_t maxWait = 250);
638668

669+
// Push (e.g.) RTCM data directly to the module
670+
// Warning: this function does not check that the data is valid. It is the user's responsibility to ensure the data is valid before pushing.
671+
boolean pushRawData(uint8_t *dataBytes, size_t numDataBytes);
672+
639673
//Survey-in specific controls
640674
struct svinStructure
641675
{
@@ -687,10 +721,18 @@ class SFE_UBLOX_GPS
687721
bool gpsDateValid;
688722
bool gpsTimeValid;
689723

724+
725+
bool gnssFixOk; //valid fix (i.e within DOP & accuracy masks)
726+
bool diffSoln; //Differential corrections were applied
690727
int32_t latitude; //Degrees * 10^-7 (more accurate than floats)
691728
int32_t longitude; //Degrees * 10^-7 (more accurate than floats)
692729
int32_t altitude; //Number of mm above ellipsoid
693730
int32_t altitudeMSL; //Number of mm above Mean Sea Level
731+
uint32_t horizontalAccEst;
732+
uint32_t verticalAccEst;
733+
int32_t nedNorthVel;
734+
int32_t nedEastVel;
735+
int32_t nedDownVel;
694736
uint8_t SIV; //Number of satellites used in position solution
695737
uint8_t fixType; //Tells us when we have a solution aka lock
696738
uint8_t carrierSolution; //Tells us when we have an RTK float/fixed solution
@@ -715,6 +757,14 @@ class SFE_UBLOX_GPS
715757

716758
uint16_t rtcmFrameCounter = 0; //Tracks the type of incoming byte inside RTCM frame
717759

760+
uint16_t geometricDOP; // Geometric dilution of precision * 10^-2
761+
uint16_t positionDOP; // Posoition dilution of precision * 10^-2
762+
uint16_t timeDOP; // Time dilution of precision * 10^-2
763+
uint16_t verticalDOP; // Vertical dilution of precision * 10^-2
764+
uint16_t horizontalDOP; // Horizontal dilution of precision * 10^-2
765+
uint16_t northingDOP; // Northing dilution of precision * 10^-2
766+
uint16_t eastingDOP; // Easting dilution of precision * 10^-2
767+
718768
#define DEF_NUM_SENS 7
719769
struct deadReckData
720770
{
@@ -804,6 +854,7 @@ class SFE_UBLOX_GPS
804854
//Functions
805855
boolean checkUbloxInternal(ubxPacket *incomingUBX, uint8_t requestedClass = 255, uint8_t requestedID = 255); //Checks module with user selected commType
806856
uint32_t extractLong(uint8_t spotToStart); //Combine four bytes from payload into long
857+
int32_t extractSignedLong(uint8_t spotToStart); //Combine four bytes from payload into signed long (avoiding any ambiguity caused by casting)
807858
uint16_t extractInt(uint8_t spotToStart); //Combine two bytes from payload into int
808859
uint8_t extractByte(uint8_t spotToStart); //Get byte from payload
809860
int8_t extractSignedChar(uint8_t spotToStart); //Get signed 8-bit value from payload
@@ -850,6 +901,9 @@ class SFE_UBLOX_GPS
850901
boolean autoPVTImplicitUpdate = true; // Whether autoPVT is triggered by accessing stale data (=true) or by a call to checkUblox (=false)
851902
boolean autoHPPOSLLH = false; //Whether autoHPPOSLLH is enabled or not
852903
boolean autoHPPOSLLHImplicitUpdate = true; // Whether autoHPPOSLLH is triggered by accessing stale data (=true) or by a call to checkUblox (=false)
904+
boolean autoDOP = false; //Whether autoDOP is enabled or not
905+
boolean autoDOPImplicitUpdate = true; // Whether autoDOP is triggered by accessing stale data (=true) or by a call to checkUblox (=false)
906+
853907
uint16_t ubxFrameCounter; //It counts all UBX frame. [Fixed header(2bytes), CLS(1byte), ID(1byte), length(2bytes), payload(x bytes), checksums(2bytes)]
854908

855909
uint8_t rollingChecksumA; //Rolls forward as we receive incoming bytes. Checked against the last two A/B checksum bytes
@@ -873,10 +927,19 @@ class SFE_UBLOX_GPS
873927
uint32_t gpsNanosecond : 1;
874928

875929
uint32_t all : 1;
930+
uint32_t gnssFixOk : 1;
931+
uint32_t diffSoln : 1;
876932
uint32_t longitude : 1;
877933
uint32_t latitude : 1;
878934
uint32_t altitude : 1;
879935
uint32_t altitudeMSL : 1;
936+
937+
uint32_t horizontalAccEst : 1;
938+
uint32_t verticalAccEst : 1;
939+
uint32_t nedNorthVel : 1;
940+
uint32_t nedEastVel : 1;
941+
uint32_t nedDownVel : 1;
942+
880943
uint32_t SIV : 1;
881944
uint32_t fixType : 1;
882945
uint32_t carrierSolution : 1;
@@ -903,6 +966,18 @@ class SFE_UBLOX_GPS
903966
uint16_t highResLongitudeHp : 1;
904967
} highResModuleQueried;
905968

969+
struct
970+
{
971+
uint16_t all : 1;
972+
uint16_t geometricDOP : 1;
973+
uint16_t positionDOP : 1;
974+
uint16_t timeDOP : 1;
975+
uint16_t verticalDOP : 1;
976+
uint16_t horizontalDOP : 1;
977+
uint16_t northingDOP : 1;
978+
uint16_t eastingDOP : 1;
979+
} dopModuleQueried;
980+
906981
uint16_t rtcmLen = 0;
907982
};
908983

‎src/u-blox_config_keys.h

+731-445
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
This repository has been archived.