Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

gps.h

Go to the documentation of this file.
00001 /*! \file gps.h \brief GPS position storage and processing library. */
00002 //*****************************************************************************
00003 //
00004 // File Name    : 'gps.h'
00005 // Title        : GPS position storage and processing function library
00006 // Author       : Pascal Stang - Copyright (C) 2002
00007 // Created      : 2002.08.29
00008 // Revised      : 2002.08.29
00009 // Version      : 0.1
00010 // Target MCU   : Atmel AVR Series
00011 // Editor Tabs  : 4
00012 //
00013 // NOTE: This code is currently below version 1.0, and therefore is considered
00014 // to be lacking in some functionality or documentation, or may not be fully
00015 // tested.  Nonetheless, you can expect most functions to work.
00016 //
00017 /// \ingroup driver_hw
00018 /// \defgroup gps GPS Positioning and Navigation Function Library (gps.c)
00019 /// \code #include "gps.h" \endcode
00020 /// \par Overview
00021 ///     This library provides a generic way to store and process information
00022 /// received from a GPS receiver.  Currently the library only stores the most
00023 /// recent set of GPS data (position, velocity, time) from a GPS receiver.
00024 /// Future revisions will include navigation functions like calculate
00025 /// heading/distance to a waypoint.  The processing of incoming serial data
00026 /// packets from GPS hardware is not done in this library.  The libraries
00027 /// tsip.c and nmea.c do the packet processing for Trimble Standard Interface
00028 /// Protocol and NMEA-0813 repectively, and store the results in this library.
00029 //
00030 // This code is distributed under the GNU Public License
00031 //      which can be found at http://www.gnu.org/licenses/gpl.txt
00032 //
00033 //*****************************************************************************
00034 
00035 #ifndef GPS_H
00036 #define GPS_H
00037 
00038 #include "global.h"
00039 
00040 // constants/macros/typdefs
00041 typedef union union_float_u32
00042 {
00043     float f;
00044     unsigned long i;
00045     unsigned char b[4];
00046 } float_u32;
00047 
00048 typedef union union_double_u64
00049 {
00050     double f;
00051     unsigned long long i;
00052     unsigned char b[8];
00053 } double_u64;
00054 
00055 struct PositionLLA
00056 {
00057     float_u32 lat;
00058     float_u32 lon;
00059     float_u32 alt;
00060     float_u32 TimeOfFix;
00061     u16 updates;
00062 };
00063 
00064 struct VelocityENU
00065 {
00066     float_u32 east;
00067     float_u32 north;
00068     float_u32 up;
00069     float_u32 TimeOfFix;
00070     u16 updates;
00071 };
00072 
00073 struct VelocityHS
00074 {
00075     float_u32 heading;
00076     float_u32 speed;
00077     float_u32 TimeOfFix;
00078     u16 updates;
00079 };
00080 
00081 struct PositionECEF
00082 {
00083     float_u32 x;
00084     float_u32 y;
00085     float_u32 z;
00086     float_u32 TimeOfFix;
00087     u16 updates;
00088 };
00089 
00090 struct VelocityECEF
00091 {
00092     float_u32 x;
00093     float_u32 y;
00094     float_u32 z;
00095     float_u32 TimeOfFix;
00096     u16 updates;
00097 };
00098 
00099 typedef struct struct_GpsInfo
00100 {   
00101     float_u32 TimeOfWeek;
00102     u16 WeekNum;
00103     float_u32 UtcOffset;
00104     u08 numSVs;
00105     
00106     struct PositionLLA PosLLA;
00107     struct PositionECEF PosECEF;
00108     struct VelocityECEF VelECEF;
00109     struct VelocityENU VelENU;
00110     struct VelocityHS VelHS;
00111 
00112 } GpsInfoType;
00113 
00114 // functions
00115 void gpsInit(void);
00116 GpsInfoType* gpsGetInfo(void);
00117 void gpsInfoPrint(void);
00118 
00119 #endif

Generated on Sun Oct 29 03:41:06 2006 for Procyon AVRlib by  doxygen 1.4.2