[WIP] Add support for Airoha AG3335 GPS (#4394)

* Add GPS detection code for Airoha AG3335

Airoha AG3335 is used in Seeed T-1000E Tracker

* Add support for Airoha AG3335

Airoha AG3335 is used in Seeed T-1000E Tracker. This adds
detection code, and code to configure its use.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Tom Fifield 2024-08-09 09:18:18 +08:00 committed by GitHub
parent 02ae24b6fa
commit b498c0bfbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 2 deletions

View File

@ -504,6 +504,22 @@ bool GPS::setup()
delay(250);
_serial_gps->write("$CFGMSG,6,1,0\r\n");
delay(250);
} else if (gnssModel == GNSS_MODEL_AG3335) {
_serial_gps->write("$PAIR066,1,0,1,0,0,1*3B"); // Enable GPS+GALILEO+NAVIC
// Configure NMEA (sentences will output once per fix)
_serial_gps->write("$PAIR062,0,0*3F"); // GGA ON
_serial_gps->write("$PAIR062,1,0*3F"); // GLL OFF
_serial_gps->write("$PAIR062,2,1*3D"); // GSA ON
_serial_gps->write("$PAIR062,3,0*3D"); // GSV OFF
_serial_gps->write("$PAIR062,4,0*3B"); // RMC ON
_serial_gps->write("$PAIR062,5,0*3B"); // VTG OFF
_serial_gps->write("$PAIR062,6,1*39"); // ZDA ON
delay(250);
_serial_gps->write("$PAIR513*3D"); // save configuration
} else if (gnssModel == GNSS_MODEL_UBLOX) {
// Configure GNSS system to GPS+SBAS+GLONASS (Module may restart after this command)
// We need set it because by default it is GPS only, and we want to use GLONASS too
@ -1218,6 +1234,14 @@ GnssModel_t GPS::probe(int serialSpeed)
return GNSS_MODEL_ATGM336H;
}
/* Airoha (Mediatek) AG3335A/M/S, A3352Q, Quectel L89 2.0, SimCom SIM65M */
clearBuffer();
_serial_gps->write("PAIR020*38\r\n");
if (getACK("$PAIR020,AG3335", 500) == GNSS_RESPONSE_OK) {
LOG_INFO("Aioha AG3335 detected, using AG3335 Module\n");
return GNSS_MODEL_AG3335;
}
// Get version information
clearBuffer();
_serial_gps->write("$PCAS06,0*1B\r\n");

View File

@ -28,7 +28,8 @@ typedef enum {
GNSS_MODEL_UBLOX,
GNSS_MODEL_UC6580,
GNSS_MODEL_UNKNOWN,
GNSS_MODEL_MTK_L76B
GNSS_MODEL_MTK_L76B,
GNSS_MODEL_AG3335
} GnssModel_t;
typedef enum {
@ -302,4 +303,4 @@ class GPS : private concurrency::OSThread
};
extern GPS *gps;
#endif // Exclude GPS
#endif // Exclude GPS