Skip to content

Commit

Permalink
v0.1.0
Browse files Browse the repository at this point in the history
* Init commit.
  • Loading branch information
vishnumaiea committed Jul 12, 2023
0 parents commit 3899f4f
Show file tree
Hide file tree
Showing 13 changed files with 953 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
6 changes: 6 additions & 0 deletions .vscode/arduino.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"configuration": "FlashFreq=80,UploadSpeed=921600,DebugLevel=none",
"board": "esp32:esp32:esp32doit-devkit-v1",
"port": "COM22",
"sketch": "examples\\Print_GPRMC\\Print_GPRMC.ino"
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files.associations": {
"array": "cpp",
"string": "cpp"
}
}
6 changes: 6 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

**+05:30 11:42:21 PM 12-07-2023, Wednesday**

* First commit.
* Version 0.1.0.

34 changes: 34 additions & 0 deletions Keywords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#######################################
# Syntax Coloring Map
#######################################

#######################################
# Datatypes (KEYWORD1)
#######################################

CSE_GNSS KEYWORD1
NMEA_0183_Data KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)
#######################################

parse KEYWORD2
print KEYWORD2
set KEYWORD2
check KEYWORD2
find KEYWORD2
count KEYWORD2
getDataIndex KEYWORD2
begin KEYWORD2
read KEYWORD2
addData KEYWORD2
getDataCount KEYWORD2
getDataRef KEYWORD2

######################################
# Constants (LITERAL1)
#######################################

PT_MODE_ONESHOT LITERAL1

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (C) 2023 Vishnu Mohanan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# CSE_GNSS

CSE_GNSS is a generic Arduino library from *CIRCUITSTATE Electronics* to read and write any GPS/GNSS module that supports NMEA output over UART. You can define the NMEA sentence formats however you want and extract the data coming from the GNSS module.
76 changes: 76 additions & 0 deletions examples/Print_GPRMC/Print_GPRMC.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

//======================================================================================//
/**
* @file Print_GPRMC.ino
* @brief Reads the NMEA output from the GNSS module and prints it on the serial monitor.
* @date +05:30 11:24:49 PM 12-07-2023, Wednesday
* @version 0.1.0
* @author Vishnu Mohanan (@vishnumaiea)
* @par GitHub Repository: https://github.com/CIRCUITSTATE/CSE_GNSS
* @par MIT License
*
*/
//======================================================================================//

#include <Arduino.h>
#include <CSE_GNSS.h>

//======================================================================================//

#define PORT_GPS_SERIAL Serial1 // GPS serial port
#define PORT_DEBUG_SERIAL Serial // Debug serial port

//======================================================================================//
// Forward declarations

void setup();
void loop();

//======================================================================================//

// Set the serial ports and the baudrate for the GNSS module.
// Both ports have to be manually initialized through begin() call.
CSE_GNSS GNSS_Module (&PORT_GPS_SERIAL, &PORT_DEBUG_SERIAL);

// GPRMC (No Second Mode indicator)
String GPRMC_Sample = "$GPRMC,165729.00,A,0902.595184,N,07632.860862,E,0.0,,031022,1.9,W,A*00";
String GPRMC_Data_Names [] = {"Header", "UTC", "Status", "Latitude", "Latitude Direction", "Longitude", "Longitude Direction", "Speed", "Course", "Date", "Mag Variation", "Mag Variation Direction", "Mode", "Checksum"};
String GPRMC_Description = "Recommended Minimum Specific GNSS Data";
NMEA_0183_Data NMEA_GPRMC ("GPRMC", GPRMC_Description, 14, GPRMC_Data_Names, GPRMC_Sample);

//======================================================================================//
/**
* @brief Setup the serial ports and pins.
*
*/
void setup() {
PORT_DEBUG_SERIAL.begin (115200);

// For ESP32 boards
PORT_GPS_SERIAL.begin (9600, SERIAL_8N1, 17, 16);

// // For other boards.
// PORT_GPS_SERIAL.begin (9600);

GNSS_Module.begin();
GNSS_Module.addData (&NMEA_GPRMC);

PORT_DEBUG_SERIAL.println();
PORT_DEBUG_SERIAL.println ("--- CSE_GNSS View_GNSS_Data ---");
delay (1000);
}

//======================================================================================//
/**
* @brief Runs indefinitely.
*
*/
void loop() {
String GNSS_Data = GNSS_Module.read ("$GPRMC");
GNSS_Module.getDataRef ("GPRMC").find (GNSS_Data, 0);
GNSS_Module.getDataRef ("GPRMC").print();
delay (10);
}

//======================================================================================//

67 changes: 67 additions & 0 deletions examples/View_GNSS_Data/View_GNSS_Data.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

//======================================================================================//
/**
* @file View_GNSS_Data.ino
* @brief Reads the NMEA output from the GNSS module and prints it on the serial monitor.
* @date +05:30 04:34:13 PM 10-07-2023, Monday
* @version 0.1.0
* @author Vishnu Mohanan (@vishnumaiea)
* @par GitHub Repository: https://github.com/CIRCUITSTATE/CSE_GNSS
* @par MIT License
*
*/
//======================================================================================//

#include <Arduino.h>
#include <CSE_GNSS.h>

//======================================================================================//

#define PORT_GPS_SERIAL Serial1 // GPS serial port
#define PORT_DEBUG_SERIAL Serial // Debug serial port

//======================================================================================//
// Forward declarations

void setup();
void loop();

//======================================================================================//

// Set the serial ports and the baudrate for the GNSS module.
// Both ports have to be manually initialized through begin() call.
CSE_GNSS GNSS_Module (&PORT_GPS_SERIAL, &PORT_DEBUG_SERIAL);

//======================================================================================//
/**
* @brief Setup the serial ports and pins.
*
*/
void setup() {
PORT_DEBUG_SERIAL.begin (115200);

// For ESP32 boards
PORT_GPS_SERIAL.begin (9600, SERIAL_8N1, 17, 16);

// // For other boards.
// PORT_GPS_SERIAL.begin (9600);

GNSS_Module.begin();

PORT_DEBUG_SERIAL.println();
PORT_DEBUG_SERIAL.println ("--- CSE_GNSS View_GNSS_Data ---");
delay (1000);
}

//======================================================================================//
/**
* @brief Runs indefinitely.
*
*/
void loop() {
String GNSS_Data = GNSS_Module.read ("$GPRMC");
delay (10);
}

//======================================================================================//

20 changes: 20 additions & 0 deletions library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "CSE_GNSS",
"keywords": "gps, sensor, NMEA, GNSS, positioing",
"description": "Arduino library for reading and writing GPS/GNSS receivers with NMEA output.",
"repository":
{
"type": "git",
"url": "https://github.com/CIRCUITSTATE/CSE_GNSS.git"
},
"authors":
{
"name": "Vishnu Mohanan",
"url": "https://github.com/vishnumaiea",
"maintainer": true
},
"version": "0.1.0",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*"
}
9 changes: 9 additions & 0 deletions library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name=CSE_GNSS
version=0.1.0
author=Vishnu Mohanan
maintainer=Vishnu Mohanan
sentence=Arduino library for reading and writing NMEA-supported GNSS/GPS modules.
paragraph=Supports all GPS and GNSS modules with NMEA data output. Directly read and write NMEA and proprietary sentences to GNSS receivers.
category=Sensor
url=https://github.com/CIRCUITSTATE/CSE_GNSS
architectures=*
Loading

0 comments on commit 3899f4f

Please sign in to comment.