Motorola M12+ GPS Engine

Functions to control the Motorola M12+ GPS engine in native binary protocol mode. More...


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.


Detailed Description

Functions to control the Motorola M12+ GPS engine in native binary protocol mode.

Define Documentation

#define GPS_BUFFER_SIZE   50

The maximum length of a binary GPS engine message.


Enumeration Type Documentation

GPS parse engine state machine values.

Enumerator:
GPS_START1  1st start character '@'
GPS_START2  2nd start character '@'
GPS_COMMAND1  Upper case 'A' - 'Z' message type.
GPS_COMMAND2  Lower case 'a' - 'z' message type.
GPS_READMESSAGE  0 - xx bytes based on message type 'Aa'
GPS_CHECKSUMMESSAGE  8-bit checksum
GPS_EOMCR  End of message - Carriage Return.
GPS_EOMLF  End of message - Line Feed.


Function Documentation

GPS_FIX_TYPE gpsGetFixType (  ) 

Get the type of fix.

Returns:
gps fix type enumeration

References GPS_2D_FIX, GPS_3D_FIX, GPS_NO_FIX, and gpsPosition.

Referenced by ballastCheck(), cutDownCheck(), gpsParsePositionMessage(), main(), tncGPGGAPacket(), tncGPRMCPacket(), and tncStatusPacket().

int32_t gpsGetPeakAltitude (  ) 

Peak altitude detected while GPS is in 3D fix mode since the system was booted.

Returns:
altitude in feet

References gpsPeakAltitude.

void gpsInit (  ) 

Initialize the GPS subsystem.

References GPS_START1, gpsParseState, gpsPeakAltitude, and gpsPosition.

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.

Returns:
true if new message available; otherwise false

References gpsPosition.

Referenced by gpsSetup(), and main().

uint8_t gpsNMEAChecksum ( uint8_t buffer,
uint8_t  length 
)

Calculate NMEA-0183 message checksum of buffer that is length bytes long.

Parameters:
buffer pointer to data buffer.
length number of bytes in buffer.
Returns:
checksum of buffer

Referenced by tncGPGGAPacket(), and tncGPRMCPacket().

void gpsParsePositionMessage (  ) 

Parse the Motorola @Hb (Short position/message) report.

References GPS_3D_FIX, gpsBuffer, gpsGetFixType(), gpsPeakAltitude, and gpsPosition.

Referenced by gpsUpdate().

Here is the call graph for this function:

void gpsPowerOff (  ) 

Turn off the GPS engine power and serial interface.

References IO_GPS_PWR.

Referenced by diagPort().

void gpsPowerOn (  ) 

Turn on the GPS engine power and serial interface.

References IO_GPS_PWR.

Referenced by diagPort().

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.

Returns:
true if GPS engine operation; otherwise false

References gpsIsReady(), gpsUpdate(), TIME_DUTYCYCLE_20, timeGetTicks(), and timeSetDutyCycle().

Referenced by main().

Here is the call graph for this function:

void gpsUpdate (  ) 

Read the serial FIFO and process complete GPS messages.

References GPS_CHECKSUMMESSAGE, GPS_COMMAND1, GPS_COMMAND2, GPS_EOMCR, GPS_EOMLF, GPS_READMESSAGE, GPS_START1, GPS_START2, gpsBuffer, gpsChecksum, gpsIndex, gpsParsePositionMessage(), gpsParseState, serialHasData(), and serialRead().

Referenced by gpsSetup(), and main().

Here is the call graph for this function:


Variable Documentation

uint8_t gpsBuffer[GPS_BUFFER_SIZE]

Buffer to store data as it is read from the GPS engine.

Referenced by gpsParsePositionMessage(), and gpsUpdate().

Checksum used to verify binary message from GPS engine.

Referenced by gpsUpdate().

Index into gpsBuffer used to store message data.

Referenced by gpsUpdate().

State machine used to parse the GPS message stream.

Referenced by gpsInit(), and gpsUpdate().

Peak altitude detected while GPS is in 3D fix mode.

Referenced by gpsGetPeakAltitude(), gpsInit(), and gpsParsePositionMessage().


Generated on Sun Oct 5 11:29:37 2008 for HF-APRS Beacon by  doxygen 1.5.7