Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
507 kaklik 1
/*! \file gps.h \brief GPS position storage and processing library. */
2
//*****************************************************************************
3
//
4
// File Name	: 'gps.h'
5
// Title		: GPS position storage and processing function library
6
// Author		: Pascal Stang - Copyright (C) 2002
7
// Created		: 2002.08.29
8
// Revised		: 2002.08.29
9
// Version		: 0.1
10
// Target MCU	: Atmel AVR Series
11
// Editor Tabs	: 4
12
//
13
// NOTE: This code is currently below version 1.0, and therefore is considered
14
// to be lacking in some functionality or documentation, or may not be fully
15
// tested.  Nonetheless, you can expect most functions to work.
16
//
17
///	\ingroup driver_hw
18
/// \defgroup gps GPS Positioning and Navigation Function Library (gps.c)
19
/// \code #include "gps.h" \endcode
20
/// \par Overview
21
///		This library provides a generic way to store and process information
22
///	received from a GPS receiver.  Currently the library only stores the most
23
/// recent set of GPS data (position, velocity, time) from a GPS receiver.
24
/// Future revisions will include navigation functions like calculate
25
///	heading/distance to a waypoint.  The processing of incoming serial data
26
///	packets from GPS hardware is not done in this library.  The libraries
27
///	tsip.c and nmea.c do the packet processing for Trimble Standard Interface
28
/// Protocol and NMEA-0813 repectively, and store the results in this library.
29
//
30
// This code is distributed under the GNU Public License
31
//		which can be found at http://www.gnu.org/licenses/gpl.txt
32
//
33
//*****************************************************************************
34
 
35
#ifndef GPS_H
36
#define GPS_H
37
 
38
#include "global.h"
39
 
40
// constants/macros/typdefs
41
typedef union union_float_u32
42
{
43
	float f;
44
	unsigned long i;
45
	unsigned char b[4];
46
} float_u32;
47
 
48
typedef union union_double_u64
49
{
50
	double f;
51
	unsigned long long i;
52
	unsigned char b[8];
53
} double_u64;
54
 
55
struct PositionLLA
56
{
57
	float_u32 lat;
58
	float_u32 lon;
59
	float_u32 alt;
60
	float_u32 TimeOfFix;
61
	u16 updates;
62
};
63
 
64
struct VelocityENU
65
{
66
	float_u32 east;
67
	float_u32 north;
68
	float_u32 up;
69
	float_u32 TimeOfFix;
70
	u16 updates;
71
};
72
 
73
struct VelocityHS
74
{
75
	float_u32 heading;
76
	float_u32 speed;
77
	float_u32 TimeOfFix;
78
	u16 updates;
79
};
80
 
81
struct PositionECEF
82
{
83
	float_u32 x;
84
	float_u32 y;
85
	float_u32 z;
86
	float_u32 TimeOfFix;
87
	u16 updates;
88
};
89
 
90
struct VelocityECEF
91
{
92
	float_u32 x;
93
	float_u32 y;
94
	float_u32 z;
95
	float_u32 TimeOfFix;
96
	u16 updates;
97
};
98
 
99
typedef struct struct_GpsInfo
100
{	
101
	float_u32 TimeOfWeek;
102
	u16 WeekNum;
103
	float_u32 UtcOffset;
104
	u08 numSVs;
105
 
106
	struct PositionLLA PosLLA;
107
	struct PositionECEF PosECEF;
108
	struct VelocityECEF VelECEF;
109
	struct VelocityENU VelENU;
110
	struct VelocityHS VelHS;
111
 
112
} GpsInfoType;
113
 
114
// functions
115
void gpsInit(void);
116
GpsInfoType* gpsGetInfo(void);
117
void gpsInfoPrint(void);
118
 
119
#endif