Defines | |
#define | GPS_BUFFER_SIZE 50 |
The maximum length of a binary GPS engine message. | |
Enumerations | |
enum | GPS_PARSE_STATE_MACHINE { GPS_START1, GPS_START2, GPS_COMMAND1, GPS_COMMAND2, GPS_READMESSAGE, GPS_CHECKSUMMESSAGE, GPS_EOMCR, GPS_EOMLF } |
GPS parse engine state machine values. More... | |
Functions | |
GPS_FIX_TYPE | gpsGetFixType () |
Get the type of fix. | |
int32_t | gpsGetPeakAltitude () |
Peak altitude detected while GPS is in 3D fix mode since the system was booted. | |
void | gpsInit () |
Initialize the GPS subsystem. | |
bool_t | gpsIsReady () |
Determine if new GPS message is ready to process. | |
uint8_t | gpsNMEAChecksum (uint8_t *buffer, uint8_t length) |
Calculate NMEA-0183 message checksum of buffer that is length bytes long. | |
bool_t | gpsSetup () |
Verify the GPS engine is sending the @Hb position report message. | |
void | gpsParsePositionMessage () |
Parse the Motorola @Hb (Short position/message) report. | |
void | gpsPowerOn () |
Turn on the GPS engine power and serial interface. | |
void | gpsPowerOff () |
Turn off the GPS engine power and serial interface. | |
void | gpsUpdate () |
Read the serial FIFO and process complete GPS messages. | |
Variables | |
uint8_t | gpsIndex |
Index into gpsBuffer used to store message data. | |
GPS_PARSE_STATE_MACHINE | gpsParseState |
State machine used to parse the GPS message stream. | |
uint8_t | gpsBuffer [GPS_BUFFER_SIZE] |
Buffer to store data as it is read from the GPS engine. | |
int32_t | gpsPeakAltitude |
Peak altitude detected while GPS is in 3D fix mode. | |
uint8_t | gpsChecksum |
Checksum used to verify binary message from GPS engine. | |
GPSPOSITION_STRUCT | gpsPosition |
Last verified GPS message received. |
#define GPS_BUFFER_SIZE 50 |
GPS parse engine state machine values.
Definition at line 1374 of file PicoBeacon.c.
GPS_FIX_TYPE gpsGetFixType | ( | ) |
Get the type of fix.
Definition at line 1424 of file PicoBeacon.c.
References GPS_2D_FIX, GPS_3D_FIX, GPS_NO_FIX, and GPSPOSITION_STRUCT::status.
Referenced by gpsParsePositionMessage(), main(), tncGPGGAPacket(), tncGPRMCPacket(), and tncStatusPacket().
int32_t gpsGetPeakAltitude | ( | ) |
Peak altitude detected while GPS is in 3D fix mode since the system was booted.
Definition at line 1445 of file PicoBeacon.c.
References gpsPeakAltitude.
Referenced by tncStatusPacket().
void gpsInit | ( | ) |
Initialize the GPS subsystem.
Definition at line 1453 of file PicoBeacon.c.
References GPS_START1, gpsParseState, and gpsPeakAltitude.
Referenced by main().
bool_t gpsIsReady | ( | ) |
Determine if new GPS message is ready to process.
This function is a one shot and typically returns true once a second for each GPS position fix.
Definition at line 1475 of file PicoBeacon.c.
References GPSPOSITION_STRUCT::updateFlag.
Referenced by gpsSetup(), and main().
Calculate NMEA-0183 message checksum of buffer that is length bytes long.
buffer | pointer to data buffer. | |
length | number of bytes in buffer. |
Definition at line 1494 of file PicoBeacon.c.
Referenced by tncGPGGAPacket(), and tncGPRMCPacket().
void gpsParsePositionMessage | ( | ) |
Parse the Motorola @Hb (Short position/message) report.
Definition at line 1546 of file PicoBeacon.c.
References GPSPOSITION_STRUCT::altitudeCM, GPSPOSITION_STRUCT::altitudeFeet, GPSPOSITION_STRUCT::day, GPSPOSITION_STRUCT::dop, GPS_3D_FIX, gpsBuffer, gpsGetFixType(), gpsPeakAltitude, GPSPOSITION_STRUCT::heading, GPSPOSITION_STRUCT::hours, GPSPOSITION_STRUCT::hSpeed, GPSPOSITION_STRUCT::latitude, GPSPOSITION_STRUCT::longitude, GPSPOSITION_STRUCT::minutes, GPSPOSITION_STRUCT::month, GPSPOSITION_STRUCT::seconds, GPSPOSITION_STRUCT::status, GPSPOSITION_STRUCT::trackedSats, GPSPOSITION_STRUCT::updateFlag, GPSPOSITION_STRUCT::visibleSats, GPSPOSITION_STRUCT::vSpeed, and GPSPOSITION_STRUCT::year.
Referenced by gpsUpdate().
void gpsPowerOff | ( | ) |
Turn off the GPS engine power and serial interface.
Definition at line 1593 of file PicoBeacon.c.
References IO_GPS_PWR.
void gpsPowerOn | ( | ) |
Turn on the GPS engine power and serial interface.
Definition at line 1579 of file PicoBeacon.c.
References IO_GPS_PWR.
Referenced by diag1PPS(), and main().
bool_t gpsSetup | ( | ) |
Verify the GPS engine is sending the @Hb position report message.
If not, configure the GPS engine to send the desired report.
Definition at line 1512 of file PicoBeacon.c.
References gpsIsReady(), gpsUpdate(), TIME_DUTYCYCLE_10, timeGetTicks(), and timeSetDutyCycle().
Referenced by main().
void gpsUpdate | ( | ) |
Read the serial FIFO and process complete GPS messages.
Definition at line 1607 of file PicoBeacon.c.
References GPS_CHECKSUMMESSAGE, GPS_COMMAND1, GPS_COMMAND2, GPS_EOMCR, GPS_EOMLF, GPS_READMESSAGE, GPS_START1, GPS_START2, gpsBuffer, gpsChecksum, gpsIndex, gpsParsePositionMessage(), gpsParseState, serialHasData(), serialRead(), and value.
Referenced by gpsSetup(), and main().
Buffer to store data as it is read from the GPS engine.
Definition at line 1408 of file PicoBeacon.c.
Referenced by gpsParsePositionMessage(), and gpsUpdate().
Checksum used to verify binary message from GPS engine.
Definition at line 1414 of file PicoBeacon.c.
Referenced by gpsUpdate().
Index into gpsBuffer used to store message data.
Definition at line 1402 of file PicoBeacon.c.
Referenced by gpsUpdate().
State machine used to parse the GPS message stream.
Definition at line 1405 of file PicoBeacon.c.
Referenced by gpsInit(), and gpsUpdate().
Peak altitude detected while GPS is in 3D fix mode.
Definition at line 1411 of file PicoBeacon.c.
Referenced by gpsGetPeakAltitude(), gpsInit(), and gpsParsePositionMessage().