Skip to content

Commit 7cf3614

Browse files
authored
Merge pull request #89 from sparkfun/release_candidate
Expand platform support
2 parents 9c38bff + e3744f0 commit 7cf3614

107 files changed

Lines changed: 17365 additions & 3909 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
examples/*/build
2+

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,25 @@ SparkFun Extensible Message Parser
33

44
The SparkFun Extensible Message Parser provides a base set of routines to construct serial stream parsers. On top of this are several GNSS protocol parsers for NMEA, RTCM, u-blox UBX, SPARTN, Septentrio SBF and Unicore. Some of SparkFun's RTK products use these parsers. Users may add protocol parse routines to enable the base routines to parse other protocols. Examples are provided for various parse configurations.
55

6+
Examples
7+
--------
8+
9+
The examples provided with library are primarily for testing however they do show:
10+
* How to initialize the parsers
11+
* How to feed data a character at a time to the parsers
12+
* How to use multiple parsers to parse a single data stream where no message is interrupted
13+
* How to use multiple parsers to parse a single data stream with interrupted messages
14+
15+
The following libraries have examples of GNSS receivers feeding data to the parsers:
16+
* [SparkFun LG290P Quadband RTK GNSS Arduino Library](https://github.com/sparkfun/SparkFun_LG290P_GNSS_Arduino_Library)
17+
* [SparkFun UM980 Triband RTK GNSS Arduino Library](https://github.com/sparkfun/SparkFun_Unicore_GNSS_Arduino_Library)
18+
619
License Information
720
-------------------
821

9-
This product is _**open source**_!
22+
This product is _**open source**_!
1023

11-
Please review the LICENSE.md file for license information.
24+
Please review the LICENSE.md file for license information.
1225

1326
If you have any questions or concerns on licensing, please contact technical support on our [SparkFun forums](https://forum.sparkfun.com/viewforum.php?f=152).
1427

check.sh

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/bin/bash
2+
#
3+
# check.sh
4+
# Script to verify example builds
5+
########################################################################
6+
set -e
7+
#set -o verbose
8+
#set -o xtrace
9+
10+
# Base_Test
11+
cd examples/Base_Test
12+
make clean
13+
make
14+
make clean
15+
16+
# Mixed_Parser
17+
cd ../Mixed_Parser
18+
make clean
19+
make
20+
make clean
21+
22+
# Multiple_Parsers
23+
cd ../Multiple_Parsers
24+
make clean
25+
make
26+
make clean
27+
28+
# NMEA_Test
29+
cd ../NMEA_Test
30+
make clean
31+
make
32+
make clean
33+
34+
# RTCM_Test
35+
cd ../RTCM_Test
36+
make clean
37+
make
38+
make clean
39+
40+
# SBF_in_SPARTN_Test
41+
cd ../SBF_in_SPARTN_Test
42+
make clean
43+
make
44+
make clean
45+
46+
# SBF_Test
47+
cd ../SBF_Test
48+
make clean
49+
make
50+
make clean
51+
52+
# SPARTN_Test
53+
cd ../SPARTN_Test
54+
make clean
55+
make
56+
make clean
57+
58+
# UBLOX_Test
59+
cd ../UBLOX_Test
60+
make clean
61+
make
62+
make clean
63+
64+
# Unicore_Binary_Test
65+
cd ../Unicore_Binary_Test
66+
make clean
67+
make
68+
make clean
69+
70+
# Unicore_Hash_Test
71+
cd ../Unicore_Hash_Test
72+
make clean
73+
make
74+
make clean
75+
76+
# User_Parser_Test
77+
cd ../User_Parser_Test
78+
make clean
79+
make
80+
make clean
81+
82+
# Return to origin directory
83+
cd ../..
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
Access_Tests.ino
3+
4+
Test access for different field sizes
5+
6+
License: MIT. Please see LICENSE.md for more details
7+
*/
8+
9+
#include <SparkFun_Extensible_Message_Parser.h> //http://librarymanager/All#SparkFun_Extensible_Message_Parser
10+
11+
extern uint8_t bufferArea[];
12+
13+
//----------------------------------------
14+
// Return the 8-bit value at the beginning of the buffer
15+
//----------------------------------------
16+
uint8_t access_8_bits(uint8_t * buffer)
17+
{
18+
sempPrintStringLn(output, "access_8_bits");
19+
return *buffer;
20+
}
21+
22+
//----------------------------------------
23+
// Return the 16-bit value at the beginning of the buffer
24+
//----------------------------------------
25+
uint16_t access_16_bits(uint8_t * buffer)
26+
{
27+
sempPrintStringLn(output, "access_16_bits");
28+
return *(uint16_t *)buffer;
29+
}
30+
31+
//----------------------------------------
32+
// Return the 32-bit value at the beginning of the buffer
33+
//----------------------------------------
34+
uint32_t access_32_bits(uint8_t * buffer)
35+
{
36+
sempPrintStringLn(output, "access_32_bits");
37+
return *(uint32_t *)buffer;
38+
}
39+
40+
//----------------------------------------
41+
// Return the 64-bit value at the beginning of the buffer
42+
//----------------------------------------
43+
uint64_t access_64_bits(uint8_t * buffer)
44+
{
45+
sempPrintStringLn(output, "access_64_bits");
46+
return *(uint64_t *)buffer;
47+
}
48+
49+
//----------------------------------------
50+
// Test the justification routines
51+
//----------------------------------------
52+
void accessTests(uint8_t * buffer)
53+
{
54+
access_8_bits(buffer);
55+
access_16_bits(buffer);
56+
access_32_bits(buffer);
57+
access_64_bits(buffer);
58+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
Arduino_Boards.h
3+
4+
Constants and routines for Arduino platforms
5+
6+
License: MIT. Please see LICENSE.md for more details
7+
*/
8+
9+
#if defined(ARDUINO_ARCH_AVR)
10+
// ARDUINO_AVR_UNO
11+
12+
//----------------------------------------
13+
// Chip specific routines
14+
//----------------------------------------
15+
16+
void initUart()
17+
{
18+
Serial.begin(115200);
19+
20+
// Delay to let the hardware initialize
21+
delay(1000);
22+
}
23+
24+
//----------------------------------------
25+
// Touch the watch dog timer to prevent a reboot
26+
//----------------------------------------
27+
#define petWDT()
28+
29+
//----------------------------------------
30+
// Output a buffer of data
31+
//----------------------------------------
32+
void output(uint8_t * buffer, size_t length)
33+
{
34+
size_t bytesWritten;
35+
36+
if (Serial)
37+
{
38+
while (length)
39+
{
40+
// Wait until space is available in the FIFO
41+
while (Serial.availableForWrite() == 0);
42+
43+
// Output the character
44+
bytesWritten = Serial.write(buffer, length);
45+
buffer += bytesWritten;
46+
length -= bytesWritten;
47+
}
48+
}
49+
}
50+
51+
//----------------------------------------
52+
// Delay for a while
53+
//
54+
// Inputs:
55+
// seconds: The number of seconds to delay
56+
//----------------------------------------
57+
void sleep(int seconds)
58+
{
59+
int count;
60+
61+
// Determine how many 100mSec intervals are in the specified seconds
62+
count = seconds * 10;
63+
while (count-- > 0)
64+
{
65+
petWDT();
66+
delay(100);
67+
}
68+
}
69+
70+
#endif // ARDUINO_ARCH_AVR

0 commit comments

Comments
 (0)