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.
GPSPOSITION_STRUCT gpsPosition
 Last verified GPS message received.


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.

Definition at line 1371 of file PicoBeacon.c.


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.

Definition at line 1374 of file PicoBeacon.c.


Function Documentation

GPS_FIX_TYPE gpsGetFixType (  ) 

Get the type of fix.

Returns:
gps fix type enumeration

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.

Returns:
altitude in feet

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.

Returns:
true if new message available; otherwise false

Definition at line 1475 of file PicoBeacon.c.

References GPSPOSITION_STRUCT::updateFlag.

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

Definition at line 1494 of file PicoBeacon.c.

Referenced by tncGPGGAPacket(), and tncGPRMCPacket().

void gpsParsePositionMessage (  ) 

void gpsPowerOff (  ) 

Turn off the GPS engine power and serial interface.

Definition at line 1593 of file PicoBeacon.c.

References IO_GPS_PWR.

Referenced by main(), and sysInit().

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.

Returns:
true if GPS engine operation; otherwise false

Definition at line 1512 of file PicoBeacon.c.

References gpsIsReady(), gpsUpdate(), TIME_DUTYCYCLE_10, 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.

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().

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.

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().

Last verified GPS message received.

Definition at line 1417 of file PicoBeacon.c.


Generated on Sun Oct 5 11:25:48 2008 for Pico Beacon by  doxygen 1.5.7