From 9afadde2f4ef8c59c80c7926d1c77153f6f9ca33 Mon Sep 17 00:00:00 2001 From: Alex Markley Date: Fri, 3 Jan 2025 18:00:39 -0500 Subject: [PATCH] Add support for LS20031 GPS module. (#5718) Hardware documentation referenced: - https://cdn.sparkfun.com/datasheets/GPS/LS20030~3_datasheet_v1.3.pdf - https://cdn-shop.adafruit.com/datasheets/PMTK%20command%20packet-Complete-C39-A01.pdf --- src/gps/GPS.cpp | 4 +++- src/gps/GPS.h | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index dcece305a..e88e774bd 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1190,6 +1190,8 @@ GnssModel_t GPS::probe(int serialSpeed) PROBE_SIMPLE("L76B", "$PMTK605*31", "Quectel-L76B", GNSS_MODEL_MTK_L76B, 500); PROBE_SIMPLE("PA1616S", "$PMTK605*31", "1616S", GNSS_MODEL_MTK_PA1616S, 500); + PROBE_SIMPLE("LS20031", "$PMTK605*31", "MC-1513", GNSS_MODEL_LS20031, 500); + uint8_t cfg_rate[] = {0xB5, 0x62, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00}; UBXChecksum(cfg_rate, sizeof(cfg_rate)); clearBuffer(); @@ -1750,4 +1752,4 @@ void GPS::toggleGpsMode() enable(); } } -#endif // Exclude GPS \ No newline at end of file +#endif // Exclude GPS diff --git a/src/gps/GPS.h b/src/gps/GPS.h index 15fc50fe7..df85b7cbf 100644 --- a/src/gps/GPS.h +++ b/src/gps/GPS.h @@ -29,7 +29,8 @@ typedef enum { GNSS_MODEL_MTK_L76B, GNSS_MODEL_MTK_PA1616S, GNSS_MODEL_AG3335, - GNSS_MODEL_AG3352 + GNSS_MODEL_AG3352, + GNSS_MODEL_LS20031 } GnssModel_t; typedef enum { @@ -239,4 +240,4 @@ class GPS : private concurrency::OSThread }; extern GPS *gps; -#endif // Exclude GPS \ No newline at end of file +#endif // Exclude GPS