1269 |
kakl |
1 |
/*! \file tsip.h \brief TSIP (Trimble Standard Interface Protocol) function library. */ |
|
|
2 |
//***************************************************************************** |
|
|
3 |
// |
|
|
4 |
// File Name : 'tsip.h' |
|
|
5 |
// Title : TSIP (Trimble Standard Interface Protocol) function library |
|
|
6 |
// Author : Pascal Stang - Copyright (C) 2002 |
|
|
7 |
// Created : 2002.08.27 |
|
|
8 |
// Revised : 2002.08.27 |
|
|
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 tsip TSIP Packet Interface for Trimble GPS Receivers (tsip.c) |
|
|
19 |
/// \code #include "tsip.h" \endcode |
|
|
20 |
/// \par Overview |
|
|
21 |
/// This library parses and decodes the TSIP data stream from a Trimble GPS |
|
|
22 |
/// and stores the position, velocity, and time solutions in the gps.c library. |
|
|
23 |
/// The library also includes functions to transmit TSIP packets to the GPS for |
|
|
24 |
/// configuration and data request. |
|
|
25 |
// |
|
|
26 |
// This code is distributed under the GNU Public License |
|
|
27 |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
|
|
28 |
// |
|
|
29 |
//***************************************************************************** |
|
|
30 |
|
|
|
31 |
#ifndef TSIP_H |
|
|
32 |
#define TSIP_H |
|
|
33 |
|
|
|
34 |
#include "global.h" |
|
|
35 |
|
|
|
36 |
// constants/macros/typdefs |
|
|
37 |
// packet delimiters |
|
|
38 |
#define DLE 0x10 |
|
|
39 |
#define ETX 0x03 |
|
|
40 |
// packet types |
|
|
41 |
// command packets |
|
|
42 |
#define TSIPTYPE_SET_IO_OPTIONS 0x35 |
|
|
43 |
// byte 0 |
|
|
44 |
#define POS_XYZ_ECEF 0 // outputs 0x42 and 0x83 packets |
|
|
45 |
#define POS_LLA 1 // outputs 0x4A and 0x84 packets |
|
|
46 |
#define POS_ALT 2 // outputs 0x4A/0x84 and 0x8F-17/0x8F-18 |
|
|
47 |
#define ALT_REF_MSL 3 // bit cleared = HAE Reference datum |
|
|
48 |
#define POS_DBL_PRECISION 4 // bit cleared = single precision |
|
|
49 |
#define SUPER_PACKETS 5 // 0x8F-17,0x8F-18,0x8F-20 |
|
|
50 |
// byte 1 |
|
|
51 |
#define VEL_ECEF 0 // outputs 0x43 |
|
|
52 |
#define VEL_ENU 1 // outputs 0x56 |
|
|
53 |
// byte 2 |
|
|
54 |
#define TIME_UTC 0 // 0/1 time format GPS/UTC |
|
|
55 |
// byte 3 |
|
|
56 |
#define RAWDATA 0 // outputs 0x5A packets |
|
|
57 |
#define RAWDATA_FILTER 1 // 0/1 raw data unfiltered/filtered |
|
|
58 |
#define SIGNAL_DBHZ 3 // 0/1 signal strength in AMU/dBHz |
|
|
59 |
|
|
|
60 |
// report packets |
|
|
61 |
#define TSIPTYPE_GPSTIME 0x41 |
|
|
62 |
#define TSIPTYPE_POSFIX_XYZ_SP 0x42 |
|
|
63 |
#define TSIPTYPE_VELFIX_XYZ 0x43 |
|
|
64 |
#define TSIPTYPE_SATSIGLEVEL 0x47 |
|
|
65 |
#define TSIPTYPE_GPSSYSMESSAGE 0x48 |
|
|
66 |
#define TSIPTYPE_POSFIX_LLA_SP 0x4A |
|
|
67 |
#define TSIPTYPE_VELFIX_ENU 0x56 |
|
|
68 |
#define TSIPTYPE_SATTRACKSTAT 0x5C |
|
|
69 |
#define TSIPTYPE_RAWDATA 0x5A |
|
|
70 |
#define TSIPTYPE_GPSSUBCODE 0x6F |
|
|
71 |
#define TSIPTYPE_POSFIX_XYZ_DP 0x83 |
|
|
72 |
#define TSIPTYPE_POSFIX_LLA_DP 0x84 |
|
|
73 |
|
|
|
74 |
|
|
|
75 |
// functions |
|
|
76 |
void tsipInit(void (*txbytefunc)(unsigned char c)); |
|
|
77 |
void tsipSendPacket(u08 tsipType, u08 dataLength, u08* data); |
|
|
78 |
u08 tsipProcess(cBuffer* rxBuffer); |
|
|
79 |
void tsipGpsDataPrint(void); |
|
|
80 |
|
|
|
81 |
// packet processing functions |
|
|
82 |
void tsipProcessGPSTIME(u08* packet); |
|
|
83 |
void tsipProcessPOSFIX_XYZ_SP(u08* packet); |
|
|
84 |
void tsipProcessVELFIX_XYZ(u08* packet); |
|
|
85 |
void tsipProcessPOSFIX_LLA_SP(u08* packet); |
|
|
86 |
void tsipProcessVELFIX_ENU(u08* packet); |
|
|
87 |
|
|
|
88 |
#endif |